In this post, we will explain how to use most popular dataTables plugin using Ajax with Codeigniter framework and also using custom searching. Datatable is a highly flexible jQuery plugin that’s used to convert HTML table into useful grid layout. DataTables is a jQuery plugin that can provide a lot of functionality like Pagination, Sorting, Filtering, Server-side processing (AJAX).

Step 1: Create Database and Table: DB Name: datatable_DB and Table Name:order_details
For this tutorial, you need a MySQL database with the following table:

Step 2: Create Model
Create a model file named Site_model.php inside “application/models” folder.

Step 3: Create Controller
Create a controller file like Order.php inside “application/controllers” folder.

Step 4: Include Library
We will Include jQuery Datatable and jQuery Library files in header

Step 5: Create views
Create a views file named index.php inside “application/views/export” folder.

Step 6: Create JavaScript file with
Create a views file named common.js inside “assets/js” folder.

Demo  

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">