Nov 01, 2012, 5:05 PM
[CLOSED] How to change store's parameter in javascript before load?
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
Store declaration
<ext:Store>
<Parameters>
<ext:StoreParameter Name="test" Value="InitialValue" />
</Parameters>
</ext:Store>
Reload Storefunction 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);
}
},
Last edited by Daniil; Nov 02, 2012 at 4:19 AM.
Reason: [CLOSED]