首页 > Windows开发 > 详细

ExtJS 5.1 WINDOW BLUR

时间:2016-01-29 20:16:37      阅读:264      评论:0      收藏:0      [点我收藏+]

Description

在ExtJS 中,当点击其他地方时,关闭 window。

Answer 1

Step 1: Register for mousedown event
this.panel.show();
Ext.getDoc().on("mousedown", this.handleDocMouseDown, this);
Step 2: Handle the event
handleDocMouseDown : function(e) {
  if (!e.within(this.panel.getEl())) {
     this.panel.destroy();
     Ext.getDoc().un("mousedown", this.handleDocMouseDown, this);
  }
}

Answer 2

Ext.applyIf(me, {
        items: [
            {
                xtype: ‘button‘,
                text: ‘Done‘,
                listeners: {
                    click: {
                        fn: me.onDoneButtonClick,
                        scope: me
                    }
                }
            }
        ],
        listeners: {
            el: {
                blur: {
                    fn: me.onWindowLoseFocus,
                    scope:me
                }
            }               
        }
    });

Reference

 

ExtJS 5.1 WINDOW BLUR

原文:http://www.cnblogs.com/yuxiaoqi/p/5103137.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!