PDA

View Full Version : trouble make new window focus (ext3.4)



karstenvennemann
21 Sep 2012, 12:12 PM
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


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();
}
}
}
}
})

willigogs
22 Sep 2012, 11:58 AM
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...