Wedgie
2 Dec 2011, 6:20 AM
On Ext 4.0.7 with Ext Designer 1.2.2
The filter() method on Ext.data.Store keeps adding new filters with each call. I don't want it to do that so I call clearFilter() first. But this causes the store to load the data, and then it loads it again when I call filter(). This happens even with the autoload config not set. Here is my Store as created by Ext Designer
Ext.define('MyApp.store.RequestListStoreForSearch', {
extend: 'Ext.data.Store',
constructor: function(cfg) {
var me = this;
cfg = cfg || {};
me.callParent([Ext.apply({
storeId: 'requestListStoreForSearch',
pageSize: 10,
remoteFilter: true,
remoteGroup: true,
remoteSort: true,
proxy: {
type: 'ajax',
simpleSortMode: true,
url: '../spring/request/list',
reader: {
type: 'array',
root: 'data'
}
},
fields: [ ...
]
}, cfg)]);
}
});
If I call this:
store.clearFilter();
store.filter(filters);
store.load();
The store gets loaded for each call, with a race as to which one gets the remote data first/last.
So how do I set and change filters dynamically please?
The filter() method on Ext.data.Store keeps adding new filters with each call. I don't want it to do that so I call clearFilter() first. But this causes the store to load the data, and then it loads it again when I call filter(). This happens even with the autoload config not set. Here is my Store as created by Ext Designer
Ext.define('MyApp.store.RequestListStoreForSearch', {
extend: 'Ext.data.Store',
constructor: function(cfg) {
var me = this;
cfg = cfg || {};
me.callParent([Ext.apply({
storeId: 'requestListStoreForSearch',
pageSize: 10,
remoteFilter: true,
remoteGroup: true,
remoteSort: true,
proxy: {
type: 'ajax',
simpleSortMode: true,
url: '../spring/request/list',
reader: {
type: 'array',
root: 'data'
}
},
fields: [ ...
]
}, cfg)]);
}
});
If I call this:
store.clearFilter();
store.filter(filters);
store.load();
The store gets loaded for each call, with a race as to which one gets the remote data first/last.
So how do I set and change filters dynamically please?