Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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".

like image 948
neolaser Avatar asked Apr 04 '11 06:04

neolaser


People also ask

What is the use of ExtJS?

Ext JS is a popular JavaScript framework which provides rich UI for building web applications with cross-browser functionality. Ext JS is basically used for creating desktop applications. It supports all the modern browsers such as IE6+, FF, Chrome, Safari 6+, Opera 12+, etc.

What is requires ExtJS?

You can look at requires as a way to tell ExtJS: "When you construct an object of this class, please make sure to dynamically load the required scripts first".

How do you destroy a window in ExtJS?

setting closeAction to destroy prior to calling close() : win. closeAction='destroy'; win. close();

What is ExtJS framework?

Ext JS is a JavaScript application framework for building interactive cross-platform web applications using techniques such as Ajax, DHTML and DOM scripting.


1 Answers

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();
like image 176
owlness Avatar answered Sep 21 '22 17:09

owlness