default filter on page load on server side processing
default filter on page load on server side processing
if (oTable.fnSettings().oFeatures.bServerSide == true) {
console.log('filterdata', filterData);
var settings = oTable.fnSettings();
$(oTable[0]).on('preXhr.dt', function ( e, settings, data ) {
var filter = [];
Object.keys(filterData).forEach(function(key,index) {
filter.push({name: key, value: filterData[key]})
});
$.extend(data, {
filter: filter
});
console.log('testdraw', settings.iDraw);
});
}
hey guys please help, am creating my own plugin to do the filter but am passing default filter from my plugin so it will filter the table on page load it works fine when i turn off server side processing but i create the above function so when i set server side to true it will send new params to the data . it appears that it doesnt send on page load but it send when i click on event change 'when i change value of the filter on page' . please help what am doing wrong here?????