Params in Ext.data.Store not passed to the server
Filed under: xn--cnq77f.com
I fixed the issue by sending in {params: 'bzzzz'} as a parameter to the load() method. However, i'd love to know why it didn't worked the expected way.
I also tried to create proxy. That went equivalently fuilure-ish as well. I'm unsure what proxy is good for but that's a story for another thread, coming soon to a forum near you.
store: new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url: 'TransferData.aspx?transactionType=download',
params: 'bzzz',
method: 'POST'
}),
reader: new Ext.data.XmlReader({record: 'row'},
[{name: 'organizationNumber', mapping: 'OrganizationNumber'}])
})
store: new Ext.data.Store({
url: 'TransferData.aspx?transactionType=download',
baseParams: 'bzzz',
reader: new Ext.data.XmlReader({record: 'row'},
[{name: 'organizationNumber', mapping: 'OrganizationNumber'}])
})
store: new Ext.data.Store({
url: 'TransferData.aspx?transactionType=download',
params: 'bzzz',
reader: new Ext.data.XmlReader({record: 'row'},
[{name: 'organizationNumber', mapping: 'OrganizationNumber'}])
})
baseParams: {bzzz: '123'}
Ext.data.Store has a configuration property baseParams (http://extjs.com/deploy/dev/docs/?class=Ext.data.Store&member=baseParams). Whatever you specify there is sent with all load requests (unless you change it programmatically).
store: new Ext.data.Store({
url: 'TransferData.aspx?transactionType=download',
baseParams: {
bzzz: 'someValue'
}
reader: new Ext.data.XmlReader(
{record: 'row'},
[
{name: 'organizationNumber', mapping: 'OrganizationNumber'}
]
)
})
Every time the store is loaded a parameter will be sent (bzzz: 'someValue').
Now, Ext.data.Store has a method called load (http://extjs.com/deploy/dev/docs/?class=Ext.data.Store&member=load)(someObject). The API says one of the properties you can specify for someObject is params (An object containing properties to pass as HTTP parameters to a remote data source).
So, if you want to load a store at some point in time with some parameters only for that particular store load then you'd do:
store.load({
params:{
start:0,
limit:6,
someParam: 'someParamValue'
}
});
AFAIK, there were never params as store's property, they were always an argument to load method. Anyway, my memory may have failed...
#If you have any other info about this subject , Please add it free.# |