Clear/reset all filters

Hi!

is it possible to clear all select comboboxes and filled textfilters and reload data with ONE buttonor function call?

bye
Marc

Please, try to use the:
grid.filterBy(0,"");
to clear all filters

and use
grid.clearAndLoad(data);
to reload data.

Thankyou, this removes the filter.

But how to clear all Dropdowns and Textboxes also?

bye,
Marc

mygrid.getFilterByElement(col_ind).value="";

I created a prototype to reset the filters. Though it works, please tell me if it could cause problems

dhtmlXGridObject.prototype.resetFilters = function(){
    if (!!this.filters){
        for(var i=0;i<this.filters.length;i++){
            if (!!this.filters[i][0]) {
                this.filters[i][0].old_value="";
                this.filters[i][0].value="";
            }
        }
        this.filterBy(0,"");
    }
};

I could not get the mygrid.getFilterByElement(col_ind).value=""; to clear the filter. I ended up using:

var element = mygrid.getFilterByElement(col_index);
element.unSelectOption();

It might be worth mentioning that I’m using the “#combo_filter” option instead of “#select_filter”.

Hi,

You can use getFilterElement ( the above response is fol older version of DHTMLX )

https://docs.dhtmlx.com/api__link__dhtmlxtreegrid_getfilterelement.html