PDA

View Full Version : keeping a window on top always



raj_plays
10 Mar 2012, 6:18 AM
32592Hi,
I use alignTo to display a window on top of another window but I am not able to force the window to stay on top of its parent.
If I click on the title bar of the parent window the other window gets hidden.
Here is the code. Please see the attached image.
The deactivate event does not get fired when 'Click Metrics' is clicked on.


Window1 = new Ext.Window({
id: 'Window1',
title: 'Click Metrics',
closable: false,
resizable: false,
draggable: false,
plain: true,
frame: true,
shadow: true,
width: 450,
height: 1200,
layout: 'fit',
items: [Grid2],
renderTo: 'input-div4'
});


Window1.show(); // Display our window


CopyWindow = new Ext.Window({
id: 'CopyWindow',
closable: false,
resizable: false,
draggable: false,
plain: true,
frame: false,
shadow: false,
layout: 'fit',
items: [{
xtype: 'label',
text: 'Copy to clipboard',
style: 'color: #15428b; font: Corbel; font-weight: bold; font-size: 10px'
}],
listeners: {
deactivate: function (self) {
self.toFront();
}
}
});


CopyWindow.show();


CopyWindow.alignTo('Window1', 'tl-tl', [8, 5]);


Please help.

mitchellsimoens
11 Mar 2012, 6:44 AM
There isn't a config to do this. You could hack into the WindowManager to change it's behavior.

raj_plays
11 Mar 2012, 10:45 PM
Thanks, Mitchell.
Can you give me a code to put in WindowManager.
It has a bringToFront method but on which event should I call it?