PDA

View Full Version : DirectStore with parameters..



zz9pa
20 Nov 2012, 1:04 AM
I can get a direct store to work with parameters by passing them in on the .load - but is there any way to pass them otherwise ?

Normally - I seem to be able to do it with something like :

store.getProxy().extraParams.paranName=somevalue
store.load()


for other store types, but this doesnt seem to pass them for a ext.data.directstore even when I've set paramOrder, ie. checking with the f12 console's show 'null' being passed for any parameters in the paramOrder.

As I said - I can use parameters if I specify them on the load :

store.load({params :
{
paranName: somevalue
}});


Any ideas ?

sword-it
20 Nov 2012, 2:12 AM
store.getProxy().extraParams.paranName=somevalue
store.load()


This is not right way to set extra params. Try this-


store.getProxy().extraParams = {paranName: 'somevalue'}
store.load()


also you can post extra params like -



store.load({
params:{
dynamicParam_1:'myValue_1',
dynamicParam_2:'myValue_2'
}
})