In ExtJs, I have a handler attached to a button, which calls submit()
on an Ext.form.Panel
. I then have a component that I am trying to refresh (store and view). What I discovered is that, the submit
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:
handler: function() {
new_folder_panel.submit();
win2.hide();
store_dir.load()
tree_dir.getView().refresh();
console.log("It is here");
}
I did try using pure javascript's window.setTimeout
, and forcing the refresh to wait which works, but I am hoping for a better way.