5
我想在ExtJS中實現以下組合框。問題是,如何使第三個選項默認選中?在組合框中預選值extjs
<select name="meter_payment_option" onChange="smart_meter(this.value)">
<option value="1">All Up-Front</option>
<option value="2">Reduced Up-Front</option>
<option value="3" selected="selected">No Up-Front</option>
</select>
我目前擁有的是:
var meter_payment_option_values = new Ext.data.SimpleStore({
fields: ['id', 'value'],
data: [
['1', 'All Up-Front'],
['2', 'Reduced Up-Front'],
['3', 'No Up-Front']]
});
var smart_meter_term = new Ext.form.ComboBox({
name: 'smart_meter_term',
editable: false,
typeAhead: false,
allowblank: false,
triggerAction: 'all',
hiddenName: 'my_dropdown',
fieldLabel: 'SmartM.T',
store: meter_payment_option_values,
displayField: 'value',
valueField: 'id',
mode: 'local'
});
如何使默認選擇第三個選項(沒有前期)?
:) – 2010-07-03 15:21:54