Datatables library |
Hello guys,
If you are using Datatables jquery plugin with Codeigniter 3, and having hard time to setup server side processing, here is the library makes things easier for you. https://github.com/n1crack/Datatables/ Installing: via composer: (start using composer if you haven't yet.) Code: composer require ozdemir/datatables set vendor path in "config/config.app": PHP Code: $config['composer_autoload'] = 'vendor/autoload.php'; And here is the ajax code. just 3 lines of code PHP Code: <?php I know there are tons of library out there. But I have learned a lot of things while playing with this. I would be happy if it helps you. Regards. Yusuf
Hello Yusuf
your library looks having a great potential and on Github I see you keep it updated I'm using xampp and I have correctly installed composer for my xampp environment One kind hint since I'm new to composer and also pretty new with Codeigniter In your Github you instruct to just run : Code: composer require ozdemir/datatables this will be run from the DOS prompt, so my hint/clarification request is regarding--> where should I locate the current dir before to run the composer command? in the main codeigniter' directory Code: D:\>cd d:\xampp\htdocs\cidttest or inside the application subdirectory Code: D:\>cd d:\xampp\htdocs\cidttest\application Thank you for clarifying Also can you kindly tell me which components and in which directories, composer will add to the project? (I know, I can check it by myself after having run it, but a brief description is welcome)
Hi,
It should be in the main directory. CI 3 already has the composer.json file as default. when you run "composer install" it will create a vendor file. Code: "require-dev": { and because of this section exists it installs some test suits for you. (if you dont want to use these, you can remove them. and run "composer update" to update vendor folder.) Still if you don't want to use composer, and only if you insist, these instructions are for you. 1- Download github repo. 2- Copy src folder into your application/libraries folder, 3- rename it to Datatables from src 4- create a new file called Datatables.php in the application/libraries folder 5- copy the codes below and save it. Datatables.php PHP Code: <?php and in your controller usage will be simply like this : PHP Code: <?php Regards
Hello,
How can I use the library if I'm using multiple databases in my Codeigniter project??
added online examples : https://datatables.ozdemir.be/
|
Welcome Guest, Not a member yet? Register Sign In |