Results 1 to 2 of 2

Thread: trouble make new window focus (ext3.4)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Sep 2008
    Posts
    29
    Vote Rating
    0
      0  

    Default trouble make new window focus (ext3.4)

    Hi,

    I am opening a new window when a user clicks on a record on a gridpanel. The result I hope for is that a new windows opens (with gridpanel window still visible), but new window on top (focused) over the gridpanel window).
    The code is in my Ext.grid.RowSelectionModel and on selection change I do open the new window and I have been trying to focus the new window via
    Ext.getCmp('editWin').focus();
    However the new window is always not foucsed and the gridpanel window on top
    once the selectionchange function finished running. Stepping through In firebug I can see that the new windows gets focused but again loses focus when selection change finshed its run and the gridpanel row that was previosly selected gets focus again...
    I also tried to deseelct the row just to make this work, but still same result. What do I need to do to make the new windos focus ?

    Below is the selection model of my grid

    Code:
            sm: new Ext.grid.RowSelectionModel({
                        singleSelect:true,
                        listeners: {              
                            selectionchange: {             
                                fn: function () {
                                      var theselectedrow = this.getSelected();
                                      if (theselectedrow != undefined){
                                            this.clearSelections();                 
                                            editWin.show();
                                            Ext.getCmp('editWin').focus();
                                      }
                                }                 
                            }                     
                        }                           
            })

  2. #2
    Sencha User
    Join Date
    Jan 2011
    Posts
    549
    Vote Rating
    54
      0  

    Default

    Try delaying the showing of the window, since its likely the full action of clicking the grid (which gives the parent window focus) fires after showing the second window...

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
  •