PDA

View Full Version : Grid - Post parameters using JsonStore



pbban
3 Jan 2011, 3:07 AM
Hi,

I am loading data into my Grid using Ext.data.JsonStore and HttpProxy.
Now i am trying to load data from the webservice based on the custom filters selected by the user. For that i need to pass the filter parameter values which is selected by the user so that the server side can process the request based on that.
How do i post custom parameters to the webservice URL using JsonStore?

Thanks
pbban

fay
3 Jan 2011, 5:29 AM
JsonStore's (http://dev.sencha.com/deploy/dev/docs/?class=Ext.data.JsonStore) load() method allows you to pass params that can be used server-side to filter your results.



store.load({
params:{
filter: 'whatever',
otherParam: 'else'
}
});



You could also modify the baseParams in the beforeload event. See the FAQ (http://www.sencha.com/learn/Ext_FAQ_Grid#Changing_the_baseParams) for more info.