1、说明
可手工输入内容的combo,当手工输入值后,提交表单时无法获取文本中的内容
2、解决
width: 200,
maxLength:20,
xtype: 'combo',
fieldLabel: '运输车牌号码',
hiddenName: 'carNumber',
id:'carNumber_id',
width: 200,
valueField: 'name',
displayField: 'name',
//editable: false,
triggerAction: 'all',
//mode: 'local',
store: new Ext.data.JsonStore({url:'dictionary/cars.do', root:'cars', fields:['id','name'], autoLoad: true}),
listeners : {//增加如下监听即可以获取手工输入的内容
select : function(combo, record, index) {
Ext.getCmp('carNumber_id').setValue(combo.getRawValue());
},
'blur' : function(f) { //焦点移出触发事件
var textvalue = this.el.dom.value;
Ext.getCmp('carNumber_id').setValue(textvalue);
}
}