ExtJ不能正确刷新

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.

查看全部
weixin_33739523
weixin_33739523
2012/11/26 16:08
  • ajax
  • extjs
  • javascript
  • 点赞
  • 收藏
  • 回答
    私信

1个回复