Is it possible to apply a certain filter to only one datatable? I have the following filter function that I am applying on document ready, I don\'t know if this is proper pr
Haven't tried, but how about something like this ?
$.fn.dataTableExt.afnFiltering.push(
function( oSettings, aData, iDataIndex ) {
if ( oSettings.nTable == document.getElementById( 'productTable' )){
var checked = $('#instock').is(':checked');
var qntStock = 1;
var stockCol = 3;
if (!checked) {
return true;
}
if (checked && aData[stockCol] > qntStock) {
return true;
}
return false;
}
}
);
the idea came from this thread : 2 datatables & 2 filters on the same page
You can also try out my yadcf plugin for datatable , here its showcase url, its has 9 different types of filters + additional API functions that can help you load table pre filtered or add single filter for filtering multiple table and many other cool stuff..