PDA

View Full Version : different labelWidth within fieldset



dvuja2
19 Feb 2010, 4:36 AM
Is this possible?


{
title: 'title',
labelWidth: 200,
defaults: { width: 100, xtype:'textfield' },
items: [
{
fieldLabel: 'Field label 1',
name: 'name1',
id:'id1'
},{
fieldLabel: 'Field label 2',
name: 'name2',
id:'id2',
labelWidth:50
}
]
}

So that inside the same fieldset the first label is 200 and the second one is 50?

dvuja2
19 Feb 2010, 5:27 AM
No?

danellison
19 Feb 2010, 6:59 AM
Hi. The Ext.Container component supports the labelWidth attribute. So something like:



var set = new Ext.form.FieldSet({
labelWidth: 200,
....
items: [
new Ext.Container({
autoEl: {},
layout: 'form',
labelWidth: 150,
....
})
]
});


should work for you.

Dan

dvuja2
19 Feb 2010, 7:16 AM
I managed to find a way... I did it like this:



{
labelWidth : 200,
items: [{
fieldLabel : 'aaa'
},{
xtype : 'panel',
layout : 'column',
items : [{

columnWidth : 1,
layout : 'form',
labelWidth : 70,
items : [{
fieldLabel : 'bbb'
}]
}]
}]
}

Animal
19 Feb 2010, 7:28 AM
Why a Panel in a Panel to house the field?

Why not just a single Container as suggested?