0
我在代碼中設置組合框的值有點麻煩。更改組合框的值Ext.form.ComboBox Ext JS
我有以下的選擇框
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'
})
所以肯定,如果我執行:
Ext.getCmp('address_type').setValue('Work')
將設置選擇框「工作地點」的價值?但它似乎沒有工作。
任何意見讚賞,謝謝。
啊!我應該仔細看看文檔!非常感謝你。 – roobotta 2010-06-29 08:23:56