PDA

View Full Version : params in Ext.data.Store not passed



alexpetri
28 Aug 2009, 12:20 PM
Hi
i have a simple DataStore:

var ds = new Ext.data.GroupingStore({
id: 'myStore',
proxy: new Ext.data.HttpProxy({url: 'listByName.req',method:'get'}),
autoLoad: false,...

somewhere else i trigger the loadEvent :


rowselect: function(smObj, rowIndex, record) {
//alert('row select !');
var vG = Ext.getCmp('myStore');
vG.getStore().load({params:{DataIdentifier:record.data.dataID}});
...

but it dont passes the parameter there is no Parameter, i set the method to POST it works - but i need to use GET
Can someone Help me?

Condor
29 Aug 2009, 2:37 AM
Your example should work.

Which Ext version are you using (it could be that this fails on some of the RC releases).

You could also try another way:

proxy: new Ext.data.HttpProxy({
api: {
read: {
url: 'listByName.req',
method:'GET'
}
}
}),

TheBerliner
30 Aug 2009, 6:49 PM
You could also try another way:


Condor,

Is this also a way to equip an existng reader with another url in order to re-use it? Which is a problem that I am currently having in EXT JS 3.

Greetings to the Dutch mountains! ;)

Condor
30 Aug 2009, 9:59 PM
A reader doesn't know anything about urls; It's only meant to interpret the data from the server.

It's the proxy that knows the url. In Ext 3 you can specify an url for each action or a global url and there is a setUrl method to change it.