ColumnFilterWidgets
ColumnFilterWidgets copied to clipboard
Add an option to include a 'clear all filters' button
Suggested by Allan, the DataTables author.
with this, you can clear all filters, when binded on button
$.fn.dataTableExt.oApi.fnResetAllFilters = function (oSettings, bDraw/default true/) { for(iCol = 0; iCol < oSettings.aoPreSearchCols.length; iCol++) { oSettings.aoPreSearchCols[ iCol ].sSearch = ''; } $('.filter-term').remove(); oSettings.oPreviousSearch.sSearch = ''; if(typeof bDraw === 'undefined') bDraw = true; if(bDraw) this.fnDraw(); }
That works nicely thanks!