PDA

View Full Version : [4.0.7] Panel doesn't resize itself when it is moved to another window



flovato
23 Oct 2011, 2:15 PM
// Step 1: Creating a simple Window with a internal panel.

lWindow1 = Ext.create('Ext.window.Window', {
title: 'Window 1',
width: 300,
height: 250,
items: [{
xtype: 'panel',
itemId: 'panInternal',
items: [{
xtype: 'button',
text: 'Test button'
}]
}]
});

lWindow1.show();

// Step 2: Creating a second Window with same dimension from first but using a 'fit' layout.

lWindow2 = Ext.create('Ext.window.Window', {
title: 'Window 2',
width: 300,
height: 250,
layout: 'fit'
});

lWindow2.show();

// Note you here that the internal panel in first window has a small height.
// When it is moved to other Window the expected is that panel automatically expands
//to fill the layout's container since the layout of the second window is 'fit'.

28811


// Step 3: Moving internal panel from Window1 to Window2.

lpanInternal = lWindow1.getComponent('panInternal');
lWindow1.remove(lpanInternal, false);
lWindow2.add(lpanInternal);



// The panel doesn't expand how expected!
28812

Did I forget something or is it a bug?