Datatable Filter Cleaning

Hi, when i select an option for a search in a multiselect filter and leave page/tab, the filter keeps the selected option, how can turn on auto clean on leave? thanks


Depending on your case, you need to use different events. For example, for the Tabbar you can use onBeforeTabClick and clean filters there. Here’s an example of cleaning all kinds of filters:

            $$("dtbl").eachColumn(function(id, col){
            var filter = this.getFilter(id);
            if (filter){
            if (filter.setValue) filter.setValue("")	// suggest-based filters 
              else filter.value = "";					// html-based: select & text

Here’s the full example: Code Snippet