PDA

View Full Version : Check if any window is open



wasima
2 Sep 2013, 11:57 PM
Hi,
I want to check programatically if any window is open. How do i do ?



Thanks in advance.

evant
3 Sep 2013, 12:02 AM
Depends what you mean by open. Rendered & shown? What about collapsed?

wasima
3 Sep 2013, 12:50 AM
Yes . Window is rendered and shown . Its not collapsed.

evant
3 Sep 2013, 3:27 AM
var allWindows = Ext.ComponentQuery.query('window'),
hasAny = false;

Ext.each(allWindows, function(win) {
if (win.isVisible() && !win.collapsed) {
hasAny = true;
return false;
}
});

ettavolt
4 Sep 2013, 1:57 AM
For 4.2:
Ext.ComponentQuery.query('window:not([collapsed]):not([hidden])').length > 0