1. #1
    Sencha User
    Join Date
    Jul 2012
    Location
    France
    Posts
    159
    Answers
    2
    Vote Rating
    3
    Elfayer is on a distinguished road

      0  

    Default Unanswered: How can I know which window is on front?

    Unanswered: How can I know which window is on front?


    Hi,

    I'm looking for something like "window.isOnFront() == true". Which doesn't exist.. =/

    Is there something similar that can tell me if the window is on front or not?

  2. #2
    Sencha - Community Support Team friend's Avatar
    Join Date
    Apr 2011
    Posts
    895
    Answers
    106
    Vote Rating
    27
    friend has a spectacular aura about friend has a spectacular aura about

      0  

    Default


    If nothing else, you can compare the Window's zindex to some other component to determine if it's 'on top':

    Code:
    if (window1.getEl().zindex > someOtherComponent.getEl().zindex) {
      // do something.
    }

  3. #3
    Sencha User
    Join Date
    Jul 2012
    Location
    France
    Posts
    159
    Answers
    2
    Vote Rating
    3
    Elfayer is on a distinguished road

      0  

    Default


    I'm doing a web desktop, so I can open multiple windows.
    With the ZIndex, can I know easily which of the windows is on front (if there is one), or must I test each against each ?

  4. #4
    Touch Premium Member
    Join Date
    Feb 2011
    Location
    NJ
    Posts
    311
    Answers
    59
    Vote Rating
    52
    droessner is a jewel in the rough droessner is a jewel in the rough droessner is a jewel in the rough

      0  

    Default


    Take a look at Ext.WindowManager. Ext.WindowManager.getActive() should give you what you are looking for.

  5. #5
    Sencha - Community Support Team sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,333
    Answers
    124
    Vote Rating
    85
    sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough

      0  

    Default


    Hi!
    i guess you have to first register your windows in WindowManager before using getActive() method of it.

    Sample:-

    Code:
    var win1 = Ext.create ('Ext.window.Window', {
      title: 'First window' ,
      id:'first',
      ..
    });
    
    var win2 = Ext.create ('Ext.window.Window', {
      title: 'Second window' ,
      id:'second',
      ..
    });
    Code:
    // Register your windows to the WindowManager
    Ext.WindowManager.register (win1);
    Ext.WindowManager.register (win2);
    Code:
    alert (Ext.WindowManager.getActive().getId ());
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

  6. #6
    Touch Premium Member
    Join Date
    Feb 2011
    Location
    NJ
    Posts
    311
    Answers
    59
    Vote Rating
    52
    droessner is a jewel in the rough droessner is a jewel in the rough droessner is a jewel in the rough

      0  

    Default


    I don't think you need to manually register the windows. See the API for http://docs.sencha.com/ext-js/4-1/#!...ethod-register

    "Registers a floating Ext.Component with this ZIndexManager. This should not need to be called under normal circumstances. Floating Components (such as Windows, BoundLists and Menus) are automatically registered with a zIndexManager at render time."