DataTables – Server-side Processing using Codeigniter, MySQL and AJAX with custom searching

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 tables into a useful grid layouts. 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.