title: Change the store api from controller in extjs
body: <p>The below is my <code>MyStore.js</code>:</p>
  
  <pre><code>Ext.define('MyApp.store.MyStore', {
      extend: 'Ext.data.Store',
      model: 'MyApp.model.Note',
      autoLoad: true,
      proxy: {
          type: 'ajax',
          api: {
              /* I want to change the following two filepaths */
              read: 'data/notesMar2013.json',
              update: 'data/notesMar2013.json' 
          },
          reader: {
              type: 'json',
              root: 'data',
              successProperty: 'success'
          }
      }
  });
  </code></pre>
  
  <p>I am trying to change the <code>read</code> and <code>update</code> values in <code>api</code> of MyStore through controller as follows:</p>
  
  <pre><code>var notesStore = Ext.getStore('MyStore');
  notesStore.on('load',function(notesStore){
          var proxy = notesStore.getProxy();
          Ext.apply(proxy.api,{
              /* Changing the file paths here */
              read: 'data/notesApr2013.json',
              update: 'data/notesApr2013.json' 
          })
          notesStore.load();                              
  },this,{single:false});
  //
  console.log(notesStore);
  </code></pre>
  
  <p>By using the above function, I am trying to update MyStore but it is not happening. When I checked in chrome console the values are changed successfully but not updating or overriding the store even I used <code>notesStore.load()</code>. What could be the problem?</p>
  
  <p>I referred the below links </p>
  
  <ul>
  <li><a href="https://stackoverflow.com/q/7670001/1577396">link1</a></li>
  <li><a href="https://stackoverflow.com/q/8025687/1577396">link2</a>            </li>
  </ul>
  
  <p><strong>Answer</strong>:  The code was working fine. Let me explain my problem: I was showing the contents from the store on a container and initially, the container was filled with some content and the height was fixed. If I even add any content to the container then it will become hidden as the container is with fixed height. Till now, the content was being <strong>appended</strong> to the default content instead of removing the default content and then adding. That was the actual problem.</p>