PDA

View Full Version : [CLOSED][3.1] Unstyled Components Do Not Display in Absolute Layouts



dancablam
18 Dec 2009, 4:20 PM
To recreate:

Use: Firefox 3.5, Ext JS 3.1.0

Expected result: Component inside an absolute layout with unstyled set to true should display.

Actual Result: Component does not display, nor does it appear to even be added to the DOM.

Code:

Ext.onReady(function(){
var tfield = {
xtype: 'textfield',
fieldLabel: 'Names',
name: 'names',
};

var panel = new Ext.Panel({
region:'center',
layout: 'absolute',
title:'Panel',
items:[{
xtype:'form',
unstyled:true,
y:40,
x:0,
labelWidth:45,
items:[tfield]
}]
});

var vp = new Ext.Viewport({
layout :'border',
items: [panel]
}).render(document.body);
});

By commenting out the layout:'absolute' or unstyled:true and the textfield will show, but with both set the component does not render. Note that in version 3.0.3 or earlier the textfield would display - this appears to be related specifically to version 3.1.0.

evant
18 Dec 2009, 6:03 PM
You haven't given the form any dimensions, which is why it doesn't size.

dancablam
18 Dec 2009, 8:27 PM
Giving the form width and height does seem to have resolved the issue. Thanks Evan.

~Dan