简体   繁体   中英

extjs removeFilter() doesn't work

I created a filter and added it to my store

checkchange: function(item, checked) {
    if (checked) {
        Ext.getCmp('gridPanel').getStore().removeFilter(item.filter);
    } else {
        Ext.getCmp('gridPanel').getStore().addFilter(item.filter);
    }
}

addFilter() works the way I want it to, but removeFilter() does nothing. clearFilter() works as well, but I want to remove only one filter, not all of them.

This will not worked you have pass exact filter object to remove filter from store

var store = Ext.getCmp('gridPanel').getStore();

store.removeFilter(store.filters.items[0]);

Extjs Doc has state that:

Removes an individual Filter from the current filter set using the passed Filter/Filter id and by default, applies the updated filter set to the Store's unfiltered dataset.

Please refer link .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM