i am using Datatable 1.9.2 in my project. I am display a list of applicants in it via AJAX. There is also a filter form which is used to filter data. Everything is working fine, but the problem is that if i filter records and no data is returned by DB then datatable generates an error in POPUP. Can someone guide me how to handle empty ajax response with datatable, how to handle empty dataset.
Below is the code which i am using
$('#applicants_list').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sPaginationType": "bootstrap",
"sDom": '<"H"Cfr>t<"F"ip>',
"oColVis": {
"activate": "mouseover",
"aiExclude": [ 10 ],
"sAlign": "left"
},
"bFilter": false,
"sAjaxSource": script.php,
"aoColumns": [
{"bSortable": true }, // attachments
{"bSortable": true }, //Subject Line
{"bSortable": true }, // Date Sent
{"bSortable": true }, // File Name
{"bSortable": false },
{"bSortable": false },
{"bSortable": true },
{"bSortable": true },
{"bSortable": true },
{"bSortable": false }
],
"aaSorting": [[0, 'desc']]
} );