PDA

View Full Version : [CLOSED]Expanding a Panel after collapsing (me.ownerCt.layout.calculateChildBox)



29er
9 Mar 2011, 10:15 AM
Hi, i tested this in 3.3 with the exact same code, and it worked fine, so I believe this might be a bug. ( I am using EXT 4.0 pr2)

This occurs when i have an expandable Ext.Panel. After collapsing and trying to expand again, i get these errors. It is occuring on all of my panels.

me.ownerCt.layout.calculateChildBox is not a function.

anim.to.height = me.ow....layout.calculateChildBox(me).height;

ext-all-debug.js (line 62104)

Here is the code:


Ext.onReady(function() {

var formpanel = new Ext.form.FormPanel( {
bodyPadding: 5,
defaults: {
anchor: '100%',
xtype:'panel',
collapsible:true
},

items: [{
flex: 1,
title: 'Customer Information',
items: [Ext.create('Ext.container.Container', {
defaults: {
border: false,
xtype: 'panel',
flex: 1,
layout: 'anchor'
},
layout: 'hbox',
items: [{
items: [{
xtype:'textfield',
fieldLabel: 'First Name',
anchor: '-5',
name: 'first'
}, {
xtype:'textfield',
fieldLabel: 'Company',
anchor: '-5',
name: 'company'
}]
}, {
items: [{
xtype:'textfield',
fieldLabel: 'Last Name',
anchor: '100%',
name: 'last'
},{
xtype:'textfield',
fieldLabel: 'Email',
anchor: '100%',
name: 'email',
vtype:'email'
}]
}]
})
]
}]
});


Ext.create('Ext.Viewport', {
layout: {
type: 'border',
padding: 5
},
defaults: {
split: true
},
items: [{
region: 'north',
collapsible: false,
title: 'Title',
height: 100,
html: 'blah'
},{
region: 'center',
title: 'Order Details',
layout: 'fit',
border: false,
items: [formpanel]
}]
});
});

evant
9 Mar 2011, 5:59 PM
It's a bug in your code, you shouldn't specify a flex value on an item not inside a box layout.

29er
9 Mar 2011, 8:05 PM
oops sorry, i looked at the 3.3 version and it worked so i figured i'd post it.
thanks!

Animal
9 Mar 2011, 10:18 PM
Heinous overnesting in your code there!

Center is a layout fit which contains a FormPanel which contains a Panel which contains a Container which contains the Fields.

Center should just be a FormPanel which contains Fields.