1. #1
    Sencha User
    Join Date
    Sep 2008
    Posts
    29
    Vote Rating
    0
    karstenvennemann is on a distinguished road

      0  

    Default trouble make new window focus (ext3.4)

    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
    544
    Vote Rating
    52
    willigogs is a jewel in the rough willigogs is a jewel in the rough willigogs is a jewel in the rough

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

Thread Participants: 1

Tags for this Thread