PDA

View Full Version : Grid paging with filters - store's baseParams do not get values



sench23
28 Apr 2011, 3:49 AM
Hi,
I have a grid that has three textfield filters (name, city, county), based on which i filter the grid remotely. Everything works fine, except with paging. Since JsonStore is in charge of paging, I found on api docs I can pass any values I want with baseParams property collection.
So I have created three methods for each textfield filter. Each of them get the value, validates and returns it.


owner.filters = new Object();
owner.filters.store = function () {
var obj = Ext.get('storeFilter');
var val = '';
if (obj != null) {
val = obj.getValue();
if (val == owner.grid.foodstoreFilterEmptyText)
val = '';
}

return val;
}

owner.filters.county = function () {
var obj = Ext.get('countyFilter');
var val = '';
if (obj != null) {
val = obj.getValue();
if (val == owner.grid.countyFilterEmptyText)
val = '';
}

return val;
}

owner.filters.city = function () {
var obj = Ext.get('cityFilter');
var val = '';
if (obj != null) {
val = obj.getValue();
if (val == owner.grid.cityFilterEmptyText)
val = '';
}

return val;
}

And here is how I set baseParams for the store

baseParams: { storeName: owner.filters.store(), city: owner.filters.city(), county: owner.filters.county() }

When I look at the network traffic, I see these params are being sent along with the request, but they are always empty. This does not work for paging because I am loading initially with Ext.Direct (so I pass these params manually).

So where do I do wrong or can I override paging event with my own code?

Thanks in advance,
Aleksandar