title: ExtJs not refreshing propertly
body: <p>In ExtJs, I have a handler attached to a button, which calls <code>submit()</code> on an <code>Ext.form.Panel</code>. I then have a component that I am trying to refresh (store and view). What I discovered is that, the <code>submit</code> component takes too long and the refresh executes too early. I was wondering if there is any way in this situation to wait until the call responds? My code looks like this:</p>
  
  <pre><code>handler: function() {
                     new_folder_panel.submit();
                     win2.hide();
                     store_dir.load()
                     tree_dir.getView().refresh();
                     console.log("It is here");
                  }
  </code></pre>
  
  <p>I did try using pure javascript's <code>window.setTimeout</code>, and forcing the refresh to wait which works, but I am hoping for a better way.</p>