就像微软操作系统(xp、vista、7 等)中的窗口一样...
如果主窗口创建模态窗口,则用户无法访问主窗口,
(包括关闭和访问工具栏等)。
我想用 extjs 做一个类似的。这是我的模态示例:
Ext.create("Ext.Window", {
title: 'aa',
width: 200,
height: 150,
html: 'a',
tbar: [{
text: 'aa',
handler: function() {
Ext.create("Ext.Window", {
title: 'aa',
width: 150,
closable: false,
height: 100,
html: 'b',
ownerCt: this,
modal: true
}).show();
}
}]
}).show();
问题是,它只是禁用主窗口的主体,用户仍然可以访问主工具栏,也可以关闭它。
我的问题是如何制作完整模态?或者如果无法完成,如何禁用主窗口,如果出现模式窗口,我在模式胜利上使用监听器显示,但问题是我无法从此监听器访问主窗口。
Edit :
到目前为止,这是我的代码:
Ext.create("Ext.Window", {
title: 'aa',
width: 200,
height: 150,
html: 'a',
maskOnDisable: false,
tbar: [{
text: 'aa',
handler: function(a) {
var parent = a.up("window");
parent.disable();
Ext.create("Ext.Window", {
title: 'aa',
width: 150,
height: 100,
html: 'b',
listeners: {
scope: this,
"close": function() {
parent.enable();
},
/*
"blur" : function(){
this.focus()
}
*/
}
}).show();
}
}]
}).show();
虽然这不是模态概念,但它看起来像我现在想要的,我有新问题,maskOnDisable
不起作用,我需要一个类似的事件blur
,因此如果用户单击父窗口,它将聚焦回弹出窗口。
(我应该将其作为新问题发布吗?)