ExtJS 4“;“永远在最上面”;窗口
我需要实现的窗口,可以始终在顶部。我该怎么做呢?所有使用WindowManager的尝试都没有结果:(在Ext.window.window中,有一个名为“modal”的属性:将其设置为true 否则,请使用窗口管理器来管理您的窗口:在这种情况下,您必须遵循以下步骤:ExtJS 4“;“永远在最上面”;窗口,extjs,Extjs,我需要实现的窗口,可以始终在顶部。我该怎么做呢?所有使用WindowManager的尝试都没有结果:(在Ext.window.window中,有一个名为“modal”的属性:将其设置为true 否则,请使用窗口管理器来管理您的窗口:在这种情况下,您必须遵循以下步骤: 将窗口注册到WindowManager(Ext.WindowManager.register(winId)) 使用bringToFront方法将窗口设置在顶部(Ext.WindowManager.bringToFront(winId
Cyaz看看这个:看看
Ext.ZIndexManager.bringToFront()
方法检查这个。很好,主要的问题是:如何检测新窗口显示在“我的窗口”上?啊,现在我知道了;)好吧,首先你必须向WindowManager注册你的窗口。然后,检查WindowManager的zIndexStack;)堆栈的第一个元素是zIndex最高的元素。Ext.WindowManager.zIndexStack[0]是您的解决方案,但我认为Ext.WindowManager.getActive()也应该做同样的事情,但在我的实验中它不起作用。。。现在看看我对整个解决方案的第一个答案:刚刚编辑;)好的,我刚刚了解了如何通过Ext.WindowManager.getActive()获得zIndex最高的窗口:您必须使用Ext.WindowManager.bringToFront(id/object),然后使用Ext.WindowManager.getActive()检查它,而不是对每个窗口使用toFront()方法查看已编辑的解决方案。再见Ext.WindowManager.zindestack[0]
是最底层的组件。它是数组的最后一个元素,由getActive()
给出。这是错误的onTop与modal:D不同
Ext.create ('Ext.window.Window', {
title: 'Your window' ,
width: 300 ,
height: 300 ,
html: 'ciao ciao' ,
modal: true
}).show ();
var win1 = Ext.create ('Ext.window.Window', {
title: 'Your window' ,
id: 'firstWin' ,
width: 300 ,
height: 300 ,
html: 'ciao ciao' ,
});
win1.showAt (50, 50);
var win2 = Ext.create ('Ext.window.Window', {
title: 'Your window' ,
id: 'secondWin' ,
width: 300 ,
height: 300 ,
html: 'I love pizza' ,
});
win2.showAt (60, 60);
// Register your floating objects (window in this case) to the WindowManager
Ext.WindowManager.register (win1);
Ext.WindowManager.register (win2);
// Bring 'firstWin' on top
Ext.WindowManager.bringToFront ('firstWin');
// Then, check the zIndexStack
alert (Ext.WindowManager.getActive().getId ()); // this is firstWin, the window with the highest zIndex