Just looking for a bit of advise here. Is the following way of setting the value of the post parameters for a store "load" method, the way to go? Or are there better ways to do it. I don't like it so much to set parameters directly, without calling a function, given by the framework. It would be nice to have something like "store.setExtraParams".

the question is: do you want those params for ALL requests, then setting extraParams is fine. if it is just for this one call, i would go for the direct way.

when adding more than one value to extraParams i would go for:

Ext.apply(store.getProxy().extraParams, {
foo : 'bar',
...
});

jvandemerwe

1 Sep 2011, 8:07 AM

Hello Tobiu,

Yes you're right by setting the parameters at store definition time. But I have some parameters that change, before the store is reloaded. I used to work in Ext 3 with the undocumented store.setBaseParams.

In my example the store is reloaded after the search field is changing and I want to refresh my results on the new value. So, yes I want this parameter constantly walking along.

And yes your "params" on the load also works in Ext 4. Just tested it and this does the job too.