Extjs读取本地下拉选框数据源,分为text和value,显示text,传值value
this.rdTypeCom=new Ext.form.ComboBox({
hiddenName:'rdType',
store:new Ext.data.SimpleStore(
{
fields:['value','text'],
data:[['1','金钱奖励'],['2','名誉奖励'],['3','惩罚']]
}),
fieldLabel:"类别",
mode:'local',
triggerAction:'all',
hideTrigger:false,
allowBlank:false,
listWidth:150,
width:150,
editable:false,
valueField:'value',
displayField:'text'
});
另一种方式:
fieldLabel : '类型',
name : 'materialType',
hiddenName:'materialType',
xtype:'combo',
triggerAction:'all',
allowBlank : false,
mode:'local',
store:new Ext.data.ArrayStore({
fields:['value','text'],
data:[
['1','材料'],
['2','工具']
]
}),
displayField:'text',
valueField:'value',
blankText:'类型是必填的',
editable:false