[CLOSED] How to change store's parameter in javascript before load?

  1. #1

    [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
    <ext:Store>               
            <Parameters>
                <ext:StoreParameter Name="test" Value="InitialValue" />
            </Parameters>
          
        </ext:Store>
    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);
            }
        },
    Last edited by Daniil; Nov 02, 2012 at 4:19 AM. Reason: [CLOSED]
  2. #2
    Hi @jchau,

    Please set an IfNotExists ApplyMode.
    <ext:StoreParameter Name="test" Value="InitialValue" ApplyMode="IfNotExists" />
  3. #3
    Confirmed working. Thanks!

Similar Threads

  1. [CLOSED] How to change a parameter store from code behind.
    By feanor91 in forum 2.x Legacy Premium Help
    Replies: 6
    Last Post: Oct 12, 2012, 11:56 AM
  2. [CLOSED] How to load store from javascript, MVC
    By RCM in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Jul 18, 2012, 12:20 AM
  3. [CLOSED] JAVASCRIPT - get parameter URL
    By rnfigueira in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jul 29, 2011, 2:53 PM
  4. [CLOSED] gridpanel store does not load dynamically from javascript
    By pattake in forum 1.x Legacy Premium Help
    Replies: 7
    Last Post: Mar 21, 2011, 6:31 PM
  5. window.Load encodes url parameter
    By thedarklord in forum 1.x Help
    Replies: 5
    Last Post: May 30, 2009, 12:13 PM

Posting Permissions