开发者

ExtJS Managing windows and detecting front window

I have an application that has many windows, which can be handled by corresponding buttons on a toolbar (sounds familiar right?!)

I currently have it so that if you click a button on the toolbar, if it is not ontop bring it to the front (toFront), if it is minimised, maximise it etc.

I want to be able to detect whether the window is the front most window...

Cheers

EDIT

TO further describe the situation: say if I have a window that is at the front, or "active". Then I click the corresponding toolbar button which minimises that window. I want to then find whic开发者_Go百科h window becomes "active".


To manage your Ext.Window instances use the Ext.WindowMgr singleton:

http://dev.sencha.com/deploy/dev/docs/?class=Ext.WindowMgr

In a button's handler:

// Assuming 'winID' has been populated with the ID of an
// Ext.Window instance associated with the button.

win = Ext.WindowMgr.get(winID);
win.show();
Ext.WindowMgr.bringToFront(win);
win.maximize();


Why not set an activeWindow property as part of the handler for clicking a button on the toolbar? If the window associated with that button is already at the front, there's nothing left to do.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜