PDA

View Full Version : Grid With Filter Params



gskluzacek
26 Feb 2010, 11:04 AM
I have a grid that is enabled with a paging toolbar. I also have a combo box and text field where the values for these are sent to the back end php script that populates the data for the grid. The idea being these 2 additional values allow the user to filter the record set (there are 10K plus records in the table displayed in the grid).

The initial problem I was running into, was when paging after the values had set for the combo and the text field, that the values for these were not being sent to the back end php script.

The solution ended up being to set the baseParams: config item on the JsonStore when creating the data store.


baseParams: {
pub_id: 0,
srch_type: 'Series equals',
srch_text: ''
},

and then when the filter is applied to call the setBaseParam() method from the handler function to set the values of the base params:


ds.setBaseParam('pub_id', combo_val);
ds.setBaseParam('srch_type', btn_text);
ds.setBaseParam('srch_text', text_val);

Hopefully this will save some one a little time.

Regards,
-- Greg