Better example for per-column filtering..

Better example for per-column filtering..

steveb321steveb321 Posts: 2Questions: 0Answers: 0
edited August 2012 in Bug reports
The current example leaves much to be desired when doing server-side processing and per-column filtering, it really is helpful to give it a delay factor - perhaps something like this could be in the documentation instead...


var do_filter = function(ele) {
/* Filter on the column (the index) of this element */
oTable.fnFilter( ele.value, $("tfoot input").index(ele));
}

$("tfoot input").keyup( function () {
var ele = this;
window.clearTimeout(window.__reports_filter_timeout);
window.__reports_filter_timeout = window.setTimeout(function() { do_filter(ele); }, 300);
});

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    There is a plug-in for the main filtering that will do that here: http://datatables.net/plug-ins/api#fnSetFilteringDelay and the example is easily extended as you have shown. Thanks for sharing your code - I'm sure others will find it useful :-)

    Allan
This discussion has been closed.