I am having a little trouble setting the value of a combo box within the code.
I have the following select box
new Ext.form.ComboBox({
id: 'address_type',
name: 'address_type',
editable: false,
disableKeyFilter: true,
forceSelection: true,
fieldLabel: 'Type',
emptyText: 'Please Select',
triggerAction: 'all',
mode: 'local',
store: new Ext.data.SimpleStore({
id: 0,
fields: ['value', 'text'],
data : [['Home', 'Home Address'], ['Work', 'Work Address']]
}),
valueField: 'value',
displayField: 'text',
hiddenName: 'address_type'
})
So surely if I executed:
Ext.getCmp('address_type').setValue('Work')
Would set the value of the select box to 'Work Address'? However it doesn't appear to work.
Any advice appreciated, thanks.