PDA

View Full Version : window should be always with user interactions.



chinnib37
6 Dec 2013, 1:19 AM
Hi,

In my application I am using model windows. Among that I want one window as always on top with user interactions.
for example:

NormalWindow.js


Ext.define('resources.views.core.NormalWindow',{
extend : 'Ext.window.Window',
height : 300,
width : 300,
modal : true,
id : 'normal window',
initComponent : function(){
this.items = [{
xtype : 'panel',
border : 0,
defaults : {
margin : '5 5 5 5'
},
items : [{
xtype : 'button',
text : 'open new window',
listeners: {
click: {
fn: this.openWindow,
scope: this,
}
}
}]
}];
return this.callParent(arguments);
},
openWindow : function(){
var win = Ext.create('resources.views.core.AlwaysOnTopWindow');
win.showAt(60,60);
}
});


AlwaysOnTopWindow.js


Ext.define('resources.views.core.AlwaysOnTopWindow',{
extend : 'Ext.window.Window',
height : 200,
width : 200,
id : 'firstWin',
initComponent : function(){
this.items = [{
xtype : 'panel',
border : 0,
defaults : {
margin : '5 5 5 5'
},
items : [{
xtype : 'button',
text : 'hello',
}]
}];
return this.callParent(arguments);
}
});



from the above code, once I open AlwaysOnTopWindow.js, it should be always with user interactions only.




After opening AlwaysOnTopWindow.js, if I closed NormalWindow.js and reopened it, then both windows should be in user interaction.
Give me idea for this..
Thanks.

scottmartin
6 Dec 2013, 6:49 AM
You should set the zindex to make it always on top. Have a look at:
http://www.sencha.com/forum/showthread.php?163870
https://fiddle.sencha.com/#fiddle/1m3

Scott