When working with ExtJs, I encountered an issue where a handler attached to a button was calling submit()
on an Ext.form.Panel
, followed by an attempt to refresh a component (store and view). The problem arose when the submit
operation took longer than expected, causing the refresh to occur too early. Is there a way to pause execution until the submit call responds in this scenario? Here is a snippet of my code:
handler: function() {
new_folder_panel.submit();
win2.hide();
store_dir.load()
tree_dir.getView().refresh();
console.log("It is here");
}
I experimented with using pure JavaScript's window.setTimeout
to delay the refresh, which did work but I am interested in finding a more optimal solution.