What I want to do is to hide the records/data from the datatable so that, by default, it will show "no data available in table". But, when the user uses the search function, it will display the matching records. If there is no data in the search and in my column filters, there will be no data to be displayed. In short, I just want my records to not appear as default. The records should only appear when searched.
Setting deferLoading: 0 doesn't load the data at first, but when I delete the info from my search bar, the records still show.
My script:
$(document).ready(function(){
var dataTable = $('#example').dataTable({
dom: 'T<"clear">lfrtip',
"tableTools": {
"sSwfPath": "../assets/swf/copy_csv_xls_pdf.swf",
"sRowSelect": "multi",
"aButtons": [
"select_all",
"select_none",
{
"sExtends": "collection",
"sButtonText": "Advance Tools",
"aButtons": [ "csv", "xls", "pdf","print" ]
}
]
},
bProcessing: true,
bServerSide: true,
bRegex:true,
"oLanguage" : {"sZeroRecords": "", "sEmptyTable": ""},
deferLoading: 0,
sAjaxSource: "server_processing.php"
});
});