PDA

View Full Version : How to use PARAMS with Ext.data.DirectProxy



kpopov
10 Sep 2009, 11:36 AM
I am having trouble using the params config option, or any other option for that matter, to pass parameters to the server side while using the Ext.data.DirectProxy class.

Here is what I am trying to do. I would like to have a grouped EditorGridPanel, and I declared the following variable:


var detailsGrid = new Ext.grid.EditorGridPanel({
ds: new Ext.data.GroupingStore({
reader: myCustomReader ,
proxy : new Ext.data.DirectProxy({
directFn: Ext.ss[myFunction].getDetails,

params:[{
uid: THE_PARAM_THAT_NEEDS_TO_BE_SENT}],
paramsAsHash: true ,
paramOrder: ['uid']
}),
autoLoad: true,
sortInfo: {field: 'sortField', direction: 'ASC'},
groupField: 'groupField'
}),
columns: []
});Everything works fine now, except that I have had to hard code the uid parameter in myFunction. When I debug the doRequest function of DirectProxy, I can see a params object but it seems to be empty.

Do you guys see what am I doing wrong? Where can I place the params or baseParams option in order to pass an argument to myFunction?

Any help would be appreciated!

Thanks.

kpopov
10 Sep 2009, 1:44 PM
OK. I guess I had to post a plea for help so that I can figure this out.

I realized that the DirectProxy class does not have params config option, so after diggin into the API help, I noticed that params is actually part of the Store load() method option. Anyway, I just ended up calling the load method with the params:{uid:'UID_TO_PASS'} and everything work fine now.