Ext desktop无法完全模式化

来源:互联网 发布:java printf输出格式 编辑:程序博客网 时间:2024/04/26 20:31

在桌面应用系统中,有时需要对当前打开的窗体模式化,即用户只能进行当前的操作,禁止使用其它功能。Ext中Ext.Window的modal控制属性可以很快捷很有效的达到这一效果,但是在我做的Ext desktop中则出现了无法完全模式化的问题。
当设置Ext.Window的modal为true时,仅仅只会屏蔽掉当前桌面,而任务栏还是可以操作

想去百度或者Google一下我都不知道这个该怎么去写关键字了,自力更生吧,自己动手丰衣足食。当然也只能去查看Ext2.2.1的API文档了,逐一查看了Ext.Window的属性介绍,最终将注意力集中到了manager控制属性上,文档说明如下:
manager : Ext.WindowGroup
A reference to the WindowGroup that should manage this window (defaults to Ext.WindowMgr).
每一个Ext.Window对象的manager默认就是Ext.WindowMgr,接着再看Ext.WindowMgr的介绍,找到zseed属性:
zseed : Number
The starting z-index for windows (defaults to 9000)
我们知道z-index是用于检索或设置对象的层叠顺序的。回过头来再看看modal的描述:
modal : Boolean
True to make the window modal and mask everything behind it when displayed, false to display it without restricting access to other UI elements (defaults to false).
也就是说显示出来的window只会屏蔽掉所有z-index值小于它自身z-index值的元素。于是乎翻开desktop的css文件,看到任务栏的定义是这样的:

 

 

zseed的默认值才是9000,而这里任务栏的z-index竟然是12001!修改方法不言而喻。

 

 

 

原创粉丝点击