PDA

View Full Version : How to prevent filters of being stored in "state"



zerkms
8 Aug 2010, 3:26 PM
Hi there

I'm using "state" to save grid's state - visible/hidden columns, theirs order, etc

But i don't need filters to be saved in state too.

Is it possible way of doing this in a simple way?

Animal
8 Aug 2010, 9:27 PM
I think this is a bug in GridFilters.

It SHOULD be configurable.

Override the init method:




init : function (grid) {
if (grid instanceof Ext.grid.GridPanel) {
this.grid = grid;

this.bindStore(this.grid.getStore(), true);
// assumes no filters were passed in the constructor, so try and use ones from the colModel
if(this.filters.getCount() == 0){
this.addFilters(this.grid.getColumnModel());
}

this.grid.filters = this;

this.grid.addEvents({'filterupdate': true});

grid.on({
scope: this,
reconfigure: this.onReconfigure
});

if (this.stateful) {
grid.on({
scope: this,
beforestaterestore: this.applyState,
beforestatesave: this.saveState,
beforedestroy: this.destroy,
reconfigure: this.onReconfigure
});
}

if (grid.rendered){
this.onRender();
} else {
grid.on({
scope: this,
single: true,
render: this.onRender
});
}

} else if (grid instanceof Ext.PagingToolbar) {
this.toolbar = grid;
}
},

zerkms
8 Aug 2010, 9:41 PM
Yeah, this change has helped. Thanks a lot.