Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
cyberhobo opened this issue Oct 11, 2011 · 2 comments
Open

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

cyberhobo opened this issue Oct 11, 2011 · 2 comments
Assignees
Labels

Comments

@cyberhobo
Copy link
Owner

Suggested by Allan, the DataTables author.

@ghost ghost assigned cyberhobo Oct 11, 2011
@Muhahe
Copy link

Muhahe commented Mar 11, 2013

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

@BenCoding
Copy link

That works nicely thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants