05-15-2016, 12:15 PM
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.)
set vendor path in "config/config.app":
And here is the ajax code. just 3 lines of code
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
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
defined('BASEPATH') OR exit('No direct script access allowed');
use Ozdemir\Datatables\Datatables;
use Ozdemir\Datatables\DB\CodeigniterAdapter;
class Welcome extends CI_Controller {
public function index()
{
$this->load->view('welcome_message');
}
public function ajax()
{
$datatables = new Datatables(new CodeigniterAdapter);
$datatables->query('Select film_id, title, description from film');
echo $datatables->generate();
}
}
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