PDA

View Full Version : store.filterBy() and store.clearFilter() do not reapply sort



cnelissen
29 Jul 2011, 12:43 PM
Neither the filterBy() method nor clearFilter() method respect the sortOnFilter property.

Proposed changes to Ext.data.Store:



filterBy : function(fn, scope) {
this.snapshot = this.snapshot || this.data.clone();
this.data = this.queryBy(fn, scope || this);
if (this.sortOnFilter && !this.remoteSort) {
this.sort();
}
this.fireEvent('datachanged', this);
},

clearFilter : function(suppressEvent) {
this.filters.clear();

if (this.isFiltered()) {
this.data = this.snapshot.clone();
delete this.snapshot;

if (this.sortOnFilter && !this.remoteSort) {
this.sort();
}

if (suppressEvent !== true) {
this.fireEvent('datachanged', this);
}
}
}