我想在窗口外单击时关闭窗口, 我想我需要在窗口后面的掩码上使用点击处理程序(是的,其modal = true)或窗口上的“onLooseFocus”-Handler ...我试过这个:
windowX.Listeners.Show.Handler = "Ext.select('.ext-el-mask').addListener('click', function() {Ext.getCmp('windowX').hide();});";
但它不起作用,Firebug也没有错误,所以我找不到错误 - 任何人都可以帮助我吗?
编辑:我正在使用Ext.Net 2.2
答案 0 :(得分:0)
我找到了this on the ext.net forums
<ext:Window runat="server" Modal="true">
<Listeners>
<Show Handler="this.mask.on('click', function () {
alert('I am the Mask!');
});"
Single="true" />
</Listeners>
</ext:Window>
修改强>
由于它不起作用,返回extjs是最佳解决方案,在this answer的帮助下代码变为
<ext:Window runat="server" Modal="true">
<Listeners>
<Show Handler="this.mon(Ext.getBody(), 'click', function (el, e) {
this.close(this.closeAction);
}, this, { delegate: '.x-mask' });"
Single="true" />
</Listeners>
</ext:Window>