PDA

View Full Version : constrain set to false but...



metalinspired
12 Oct 2012, 2:57 AM
Hi all,

Today I encountered a strange behavior with window.
I have a window that opens another window as its child.
I can move child window outside parent window (since constrain is set to false) but when I start resizing child window it is snapping to parent window borders.
Is this a bug or I'm missing something?

scottmartin
12 Oct 2012, 9:09 AM
Can you please put together a small test case so we are looking at the same issue?

Scott.

metalinspired
12 Oct 2012, 10:46 AM
Here you go.


Ext.require([
'Ext.window.*',
]);

Ext.create(function() {
var win1 = Ext.create('Ext.window.Window', {
title: 'Window1',
width: 400,
height: 400,
});
var btn = Ext.create('Ext.button.Button', {
text: 'click me',
handler: function() {
var win2 = Ext.create('Ext.window.Window', {
title: 'Window2',
width: 200,
height: 200,
});
win1.add(win2);
win2.show();
},
});
win1.add(btn);
win1.show();
});​

or http://jsfiddle.net/metalinspired/LZqFF/

scottmartin
12 Oct 2012, 12:20 PM
By adding win2 to win1, is your goal to make it topmost window until closed .. like modal?

I am trying to decide if the issue is the resize, or that you can move it outside of parent.

Scott.

metalinspired
13 Oct 2012, 12:38 AM
I want win2 to be child of win1 so it would stay on top of it.
In my code I have a grid in win1 and editing form in win2.
When I open win2 I disable win1 (I didn't do it in snippet but results are same) until user finishes adding/editing a record.
I have no intention of keeping win2 encapsulated in win1, it just suppose to be on top of it as its child.

scottmartin
13 Oct 2012, 10:46 AM
Can you just make a modal window?



Ext.create(function() {
var win1 = Ext.create('Ext.window.Window', {
title: 'Window1',
width: 400,
height: 400,
});
var btn = Ext.create('Ext.button.Button', {
text: 'click me',
handler: function() {
var win2 = Ext.create('Ext.window.Window', {
title: 'Window2',
width: 200,
height: 200,
modal: true
}).show();
},
});
win1.add(btn);
win1.show();
}); ​


Scott.

metalinspired
14 Oct 2012, 3:17 AM
No, I can not make it modal because user has to have ability to work with other windows while editing record in this one.
Also by using this approach (including disabling parent window) I prevent possibility of user "tabbing" to parent window buttons an possibly opening a same form twice thus creating confusion.