PDA

View Full Version : 2 Fields form layout, directly behind eachother



digitalhuman
13 Jun 2010, 11:16 PM
Is it possible to put 2 fields direcly behind eachother. 1 with fieldlabel and 1 without.
<streetname><housenumber>

Condor
13 Jun 2010, 11:28 PM
Use a CompositeField.

Or, if you are not using Ext 3.2, use a container with hbox or column layout with 2 fields inside.

digitalhuman
14 Jun 2010, 12:05 AM
Ok, I found a way to:



layout: 'table',
hideBorders: true,
items: [
{
column: .5,
layout: 'form',
style: 'margin-right: 10px;',
items: [
{xtype: 'textfield', width: 150, fieldLabel: 'Straat',name: 'ADRES'}
]
},
{
column: .5,
layout: 'form',
items: [
{xtype: 'textfield', width: 30, name: 'Huis', hideLabel: true}
]
}
]

Condor
14 Jun 2010, 12:17 AM
I would recommend using column+anchor layout instead, e.g.

{
fieldLabel: 'Straat/huisnummer',
xtype: 'container',
layout: 'column',
defaults: {
xtype: 'container',
layout: 'anchor',
defaults: {
anchor: '0',
xtype: 'textfield'
}
},
items: [{
width: 200,
items: {
name: 'ADRES'
}
},{
width: 50,
items: {
name: 'Huis'
}
}]
}