View Full Version : [CLOSED] How to change store's parameter in javascript before load?

Nov 01, 2012, 6:05 PM
I can't seem to figure this out. I declare a store with parameters. After store loads, I want to reload store with new parameter. But the new parameter value never gets back to the server.

Store declaration

<ext:StoreParameter Name="test" Value="InitialValue" />


Reload Store

function ReloadGrid() {
var store = someGrid.getStore();
store.reload({ test: 'NewValue' });

Took me a long time to finally trace source code to this method. Not sure if this is a bug but the order of operation is suspect here. It is overriding the params I sent to the load function with the initial parameters declared in store markup.

buildReadParams : function (operation) {
var prms = this.readParameters(operation);

operation.params = operation.params || {};

if (prms.apply) {
Ext.apply(operation.params, prms.apply);

if (prms.applyIf) {
Ext.applyIf(operation.params, prms.applyIf);

Nov 01, 2012, 6:36 PM
Hi @jchau,

Please set an IfNotExists ApplyMode.

<ext:StoreParameter Name="test" Value="InitialValue" ApplyMode="IfNotExists" />

Nov 01, 2012, 7:24 PM
Confirmed working. Thanks!