I have to filter a grid store from a set of textfield/combobox inserted in the top of the page in a separated Ext.form.Panel. I use this code for do the grid filter:
doGridFilters : function() {
//storeClients.clearFilter();
var client_Id = Ext.getCmp('Id_form').getValue();
var filter1 = Ext.create('Ext.util.Filter',{
root:'list',
comparison: 'eq',
property: "Id",
value: client_Id
});
storeClients.getProxy().extraParams = { filter: filter1 };
storeClients.load();
},
but the store don't perform any type of filter.
Can anyone help me?
Remotefiltering is quite easy:
...filter:[{property:'Name', value:'value'}]...
And that's all. The remoteFilter
property can be changed each time before applying a filter. For your case:
doGridFilters : function(grid) {
var store = grid.store;
store.clearFilter();
store.remoteFilter = true;// optional
var client_Id = Ext.getCmp('Id_form').getValue();
store.on('load', function(s){ s.remoteFilter = false; }, this, { single: true }) // optional
store.filter("Id",client_Id);
}
Note: The proxy will always only apply the property-value paired filter, nothing more [ExtJS 4.1.1] For more you will need to override the responsible proxy function