I\'m using the datatables plugin with server-side data and am updating the table using AJAX.
My dataTables setup looks like this:
tblOrders = parame
Similar to Mitja Gustin answer. Changed a loop, added sNewSource.
$.fn.dataTableExt.oApi.fnReloadAjax = function (oSettings, sNewSource, myParams ) {
if(oSettings.oFeatures.bServerSide) {
if ( typeof sNewSource != 'undefined' && sNewSource != null ) {
oSettings.sAjaxSource = sNewSource;
}
oSettings.aoServerParams = [];
oSettings.aoServerParams.push({"sName": "user",
"fn": function (aoData) {
for(var index in myParams) {
aoData.push( { "name" : index, "value" : myParams[index] });
}
}
});
this.fnClearTable(oSettings);
return;
}
};
var myArray = {
"key1": "value1",
"key2": "value2"
};
var oTable = $("#myTable").dataTable();
oTable.fnReloadAjax(oTable.oSettings, myArray);