neolaser
neolaser

Reputation: 6907

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 which window becomes "active".

Upvotes: 8

Views: 10002

Answers (2)

owlness
owlness

Reputation: 2936

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();

Upvotes: 6

wombleton
wombleton

Reputation: 8376

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.

Upvotes: 0

Related Questions