我需要实现可以始终位于顶部的 Window。我该怎么做?我对 WindowManager 的所有尝试都没有给我任何结果:(
最佳答案
在 Ext.window.Window 中,有一个名为 'modal' 的属性:将其设置为 true。
否则,请使用 窗口管理器 管理您的窗口:在这种情况下,您必须按照以下步骤操作:
例如。:
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
希望这对你有帮助。
氰化物
关于ExtJS 4 "always on top"窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10433925/