Results 1 to 5 of 5

Thread: Check if any window is open

  1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    64

    Default Answered: Check if any window is open

    Hi,
    I want to check programatically if any window is open. How do i do ?



    Thanks in advance.

  2. Code:
    var allWindows = Ext.ComponentQuery.query('window'),
         hasAny = false;
    
    Ext.each(allWindows, function(win) {
        if (win.isVisible() && !win.collapsed) {
            hasAny = true;
            return false;
        }
    });

  3. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,258
    Answers
    759

    Default

    Depends what you mean by open. Rendered & shown? What about collapsed?
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  4. #3
    Sencha User
    Join Date
    Dec 2011
    Posts
    64

    Default

    Yes . Window is rendered and shown . Its not collapsed.

  5. #4
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,258
    Answers
    759

    Default

    Code:
    var allWindows = Ext.ComponentQuery.query('window'),
         hasAny = false;
    
    Ext.each(allWindows, function(win) {
        if (win.isVisible() && !win.collapsed) {
            hasAny = true;
            return false;
        }
    });
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  6. #5
    Sencha User
    Join Date
    Sep 2011
    Posts
    574
    Answers
    59

    Default

    For 4.2:
    Code:
    Ext.ComponentQuery.query('window:not([collapsed]):not([hidden])').length > 0

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •