ColumnFilterWidgets icon indicating copy to clipboard operation
ColumnFilterWidgets copied to clipboard

Add an option to include a 'clear all filters' button

Open cyberhobo opened this issue 13 years ago • 2 comments

Suggested by Allan, the DataTables author.

cyberhobo avatar Oct 11 '11 14:10 cyberhobo

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(); }

Muhahe avatar Mar 11 '13 18:03 Muhahe

That works nicely thanks!

BenCoding avatar Apr 15 '13 22:04 BenCoding