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

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'


// 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'


// 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'.


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

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

// The panel doesn't expand how expected!

Did I forget something or is it a bug?