PDA

View Full Version : sending params while query in ComboBox



parveenbeniwal
21 Aug 2007, 5:55 AM
I have a combo box in the Grid as a Editor. I want to pass some arguments while its going to fetch data from server so that it can fetch data on basis of some condition. How i can achieve the same ? Any help is appreciated. Its urgent for me.

fay
21 Aug 2007, 6:02 AM
See: http://extjs.com/deploy/ext/docs/output/Ext.data.Store.html#load and http://extjs.com/deploy/ext/docs/output/Ext.data.Store.html#config-baseParams

For example:


dsMarkets = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({url: '../Scripts/GetMarkets.aspx'}),
reader: new Ext.data.XmlReader({record: 'Market', id: '@Id'}, [
{name: 'MarketId', mapping: '@Id'},
{name: 'Text', mapping: '@Text'},
{name: 'MarketType', mapping: '@MarketType'}
]),
baseParams: {Language: 'ENGLISH'}
});

or


dsMarkets.load({params: {Language: 'ENGLISH'}});

parveenbeniwal
21 Aug 2007, 6:08 AM
Thanks for this quick reply. if i am not wrong then it should fire on some event. I mean whenevr I expand the combo.

fay
21 Aug 2007, 6:24 AM
I don't completely understand what you are trying to do - the first bit of code I posted shows you how to pass params to the URL that populates a datastore. I'm not sure which 'event' you are talking about - when do you want to fill the combobox? Can you explain your requirement a bit more...

parveenbeniwal
21 Aug 2007, 6:38 AM
I have my ans now. Thanks. Actually when default fetching is done with base params then its fetches data from server only only once. I just wanted to know the name of event. Thanks again.