ServerProcessing and local ajax search using DataTables 1.10
ServerProcessing and local ajax search using DataTables 1.10
Hi,
I am having an issue making both serverside with parameters and the ajax search box work. I have my datatables initialized like this
var table = $('#recommendations_table');
table.DataTable({
"processing": true,
"serverSide": true,
"sAjaxSource": "scripts/recommendations_processing.php",
"fnServerParams": function (aoData) {
aoData.push({ "name": "cid", "value": $('#committee_one').val() });
aoData.push({ "name": "mid", "value": $('#ministry_one').val() });
aoData.push({ "name": "sid", "value": $('#sector_one').val() });
}
});
With that I have the table and the server parameters working but the ajax search box is not filtering my search queries. I had tested the same code above with ajax parameter instead of sAjaxSource and without the fnServerParams, that test had both the table and the search box working ok. So I'm left to wonder how do you pass server parameters in the new datatables and have all the features working including the search box filtering.
Thanks
Answers
I think I got it working after digging into the docs: