So I have a page where when it first loads, the Datatable should be empty. But when user clicks search, the Datatable will load data using a JSON source.
On initialization, I try to send a "zero" parameter to my controller, which will then return empty data.
siInfoTable = $('#siInfoTable').DataTable({
"ajax":{
"url":"http://localhost:9000/milestone/api/si_info/all",
"data": function(d){
d.zero=true;
}
})
Then when user clicks search, I try something like this, but it doesn't work.
siInfoTable.ajax({
"data": function(d){
//New parameters here
}
});
I tried other ways too, but I can only configure the AJAX of datatable once. I thought of just running a query asking for 0 rows using pageLength
, but that doesn't seem too ideal.
Any idea?