title: Changing store extraParams before grid sortchange event
body: <h1>Requirement</h1>
  
  <p>Every time grid data is sorted - before the event is executed I want to change the store <code>extraParams</code> with the values of new sort properties. Like If I am sorting a column <em>Name</em> in <em>DESC</em> direction - before the event is <strong>executed</strong> I want to overwrite <code>extraParams</code> of store with <code>dataIndex</code> of <em>Name</em> column and direction property <em>DESC</em>.</p>
  
  <p>My store also has <code>remoteSort</code> property set to <code>true</code>.</p>
  
  <p>I am using ExtJS 4.2.</p>
  
  <h1>Problem</h1>
  
  <p>I tried <code>sortchange</code> event listener on grid but it is executed after the data API is called and records are loaded. What I would like to have is something like <em>beforesortchange</em>. </p>
  
  <p>This all with <code>remoteSort : true</code>.</p>
  
  <p>Next problem is if i call <code>this.getStore().load();</code> from <code>sortchange</code> then my data api is called twice, which does not make sense.</p>
  
  <h1>Code</h1>
  
  <p>Grid listener:</p>
  
  <pre><code>sortchange: function(ct, column, direction, eOpts) {
      this.getStore().getProxy().extraParams = {
          'sort'  : column.dataIndex,
          'dir'   : direction
      }
      //  load() will call the data api again once the data loading is over
      //this.getStore().load();
  }
  </code></pre>
  
  <p>I tried following grid listeners also but either I dont get new grid sort parameters or they are not called at all:
  <code>beforeload</code>, <code>beforesync</code>, <code>beforeprefetch</code>, <code>load</code>.</p>
  
  <h1>References</h1>
  
  <p><a href="https://stackoverflow.com/questions/12338407/custom-function-call-after-extjs-4-grid-sort/12338906#12338906" title="Check Guo Yu reply">https://stackoverflow.com/questions/12338407/custom-function-call-after-extjs-4-grid-sort/12338906#12338906</a></p>