I am using Datatables to display tabular data in my Web application, and have configured it to make use of server-side processing, i.e. query the server via AJAX for filtered da
This worked for me
$(document).ready(function() {
table = $('#okmorders').DataTable( {
// "ajax": 'http://cdpaha2.dev/admin/organizations/okm_orders'
serverSide: true,
"paging": true,
"searching": false ,
// "info": false,
"bLengthChange": false,
// "iDisplayLength":50,
// "aaSorting": [],
// "oLanguage": { "sEmptyTable": "No orders present " } ,
"aoColumnDefs" : [
{ 'bSortable' : false, 'aTargets' : [ 6 ]}
],
// "fnServerParams": function (aoData) {
// aoData.push({name: "includeUsuallyIgnored"});
// },
ajax: {
url: 'yoururl.json' ,
type: 'POST',
data:
{
'startDate':function(){return $("#startDate").val(); },
'endDate': function(){return $("#endDate").val(); } ,
'placedBy':function(){return $("#placedBy").val(); },
'customer_po': function(){return $("#customer_po").val(); } ,
'customer_ref': function(){return $("#customer_ref").val(); }
}
},
} );