weixin_33739523 2012-11-26 16:08 采纳率: 0%
浏览 26

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.

  • 写回答

1条回答 默认 最新

  • weixin_33739541 2012-11-26 16:27
    关注

    Yes, you have to use the success callback as follow:

    handler: function() {
        new_folder_panel.submit({
            success : function(){
               win2.hide();
               store_dir.load()
               tree_dir.getView().refresh();
               console.log("It is here");
            }
        });
    }
    

    I didn´t test it but this is the way to go.

    Good luck!

    评论

报告相同问题?

悬赏问题

  • ¥20 蓝牙耳机怎么查看日志
  • ¥15 Fluent齿轮搅油
  • ¥15 八爪鱼爬数据为什么自己停了
  • ¥15 交替优化波束形成和ris反射角使保密速率最大化
  • ¥15 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏