PDA

View Full Version : Fixed label widths on fields



parky128
20 Jan 2012, 5:43 AM
I am trying to achieve fixed label widths in fieldsets on a form panel, so I have just set defaults labelWidths as per my code below:


Ext.define('PinpointersTouch.view.PreferencesView', {
extend: 'Ext.form.Panel',
xtype: 'prefsview',
config: {
fullscreen:true,

items: [
{
xtype : 'toolbar',
docked: 'top',
title: 'User Preferences'
},{
xtype: 'fieldset',
title: 'Map Options',
defaults: {
labelWidth: '200',
},
items: [
{
xtype: 'checkboxfield',
itemId : 'chkShowTraffic',
label: 'Show Traffic Layer'
},
{
xtype: 'checkboxfield',
itemId : 'chkShowUnitLabels',
label: 'Show Unit Labels'
},{
xtype: 'checkboxfield',
itemId : 'chkShowPlacemarkers',
label: 'Show Placemarkers'
}
]
},{
xtype: 'fieldset',
title: 'Auto Update Options',
defaults: {
labelWidth: '200',
},
items: [
{
xtype: 'checkboxfield',
itemId : 'chkEnableAutoUpdate',
label: 'Enable Auto Update'
},
{
xtype: 'selectfield',
label: 'Auto Update Interval',
options:[
{text: '1 Minute', value: 60},
{text: '3 Minutes', value: 120},
{text: '5 Minutes', value: 300},
{text: '10 Minutes', value: 600}
]
}
]
},{
xtype : 'toolbar',
docked: 'bottom',
layout : {
pack : 'right'
},
items: [
{
xtype : 'button',
text: 'Done',
itemId: 'btnDone'
}
]
}
]
}
});


I end up with field labels looking like the attached image, so they are of varying lengths. How can I get them to stay the same fixed size?

mitchellsimoens
20 Jan 2012, 7:22 AM
'200' should be '200px'