ExtJS 5.1 WINDOW BLUR
2016-01-29 15:30
609 查看
Description
在ExtJS 中,当点击其他地方时,关闭 window。Answer 1
Step 1: Register for mousedown eventthis.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
How to simulate onblur event for a Panel in ExtjsExtJS floating window focus lose detection
相关文章推荐
- js:Razor视图下服务器代码给Javascript变量赋值
- 【JSOI2008】【BZOJ1014】火星人prefix
- 详解javascript实现瀑布流绝对式布局
- JS中Array的使用
- JSP自定义标签之简单标签入门
- JSP自定义标签之简单标签入门
- 原生JavaScript+ajax
- js跨域及解决方案
- jsp分页代码之pageUtil类
- baidu touch.js在某些机子(Motorola XT531)上旋转不动
- js的RSA和AES加密解密
- target 属性怎么用 JS 来控制?
- js截取字符串
- 理解Javascript文件动态加载
- JSON 使用异常
- JS中的prototype
- JavaScript函数声明、变量声明及赋值的优先级问题
- JS禁止用F5键
- 使用javascript全局改变CSS样式(网页样式)
- js中的基本正则以及过滤特殊字符