PDA

View Full Version : How to align two items horizontally?



new2extjs
23 Feb 2012, 12:38 AM
I have a form panel with items like


{
fieldLabel: 'User',
xtype: 'textfield'
},
{
xtype: 'button',
},


How to align them horizontally so that they appear next to eachother with some space?

vietits
23 Feb 2012, 12:58 AM
Let have a try with FieldContainer with hbox layout.

new2extjs
23 Feb 2012, 1:27 AM
Thanks a lot!
It worked but for giving space between two elements , I tried to use


{ xtype: 'spacer',
width: 10
}


but it didn't work. Seems it is not supported in Extjs 4. Is there an alternative for this?

vietits
23 Feb 2012, 1:43 AM
You can insert in between a general component


},{
xtype: 'component',
width: 10
},{

new2extjs
23 Feb 2012, 2:16 AM
It worked .Thanks a lot !!!