I have a simple grid and store. I need to save the current sorting and filtering and apply them later dynamically. When I apply the sorting to the store the grid directry reflects the change (I see an Arrow in the column-header), but when I change the filtering on the store the changes are not reflected in the grid-columns. The store itself is filtered. (I use remote store)
To get the actual sorting I use the following code:
Code:
var sortStates = [];
if (store) store.getSorters().each(function (item, index) {
sortStates.push(item.serialize());
});
To apply the sorting I use the following code:
Code:
var sorters = store.getSorters();
for (var i = 0, sortState; sortState = sortStates[i]; i++) {
sorters.add(new Ext.util.Sorter(sortState));
}
The grid directly reflects the sorting by showing the right arrow in the column-headers.
I use simular code for the filtering:
Code:
//Get filters
var filters = [];
if (store) store.getFilters().each(function (item, index) {
filters.push(item.serialize());
});
To apply the filter I use the following code:
Code:
for (var i = 0, fltState; fltState = filters[i]; i++) {
filters.add(new Ext.util.Filter(fltState));
fltChange = true;
}
But the filter is not reflected in the grid. The store itself is filtered..
Any suggestion where to look?
regards,
Arno.