• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Datatables library

#1
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 Smile 

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
Reply


Messages In This Thread
Datatables library - by numberone - 05-15-2016, 12:15 PM
RE: Datatables library - by Corsari - 06-19-2017, 11:21 PM
RE: Datatables library - by numberone - 06-20-2017, 11:50 AM
RE: Datatables library - by lowld - 11-14-2017, 02:16 PM
RE: Datatables library - by numberone - 12-28-2018, 12:55 PM
RE: Datatables library - by numberone - 10-03-2020, 01:53 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.