PDA

View Full Version : Simple Layout not Working



rvelasquez
25 Apr 2012, 12:20 PM
Hi,

I'm trying to nest an hbox inside a vbox. Seems fairly straightforward but I can't get the layout to display the two pieces of text. I can see the titlebar though.



Ext.define("senchatest.view.Main", {
extend: 'Ext.Container',
xtype: 'mainview',

config: {
layout: {
type: 'vbox',
},
items: [
{
xtype: 'titlebar',
title: 'Title',
docked: 'top'
},
{
xtype: 'container',
config: {
layout: {
type: 'hbox'
},
items: [
{
html: '<p>Content 1</p>'
},
{
html: '<p>Content 2</p>'
}
]
}
}
]
}
});

wilzdezign
25 Apr 2012, 3:41 PM
I do not think you need the nested config, as that is used as part of the initial Ext.define()
Does this work:

Ext.define("senchatest.view.Main", {
extend: 'Ext.Container',
xtype: 'mainview',

config: {
layout: {
type: 'vbox',
},
items: [
{
xtype: 'titlebar',
title: 'Title',
docked: 'top'
},
{
xtype: 'container',
layout: 'hbox',
items: [
{
html: '<p>Content 1</p>'
},
{
html: '<p>Content 2</p>'
}
]
}
]
}
});

rvelasquez
26 Apr 2012, 7:16 AM
Thanks that worked great! No I know to not use the config attribute for objects not created with Ext.define.