EXTJS2.2组件Combobox-lovcombo多选框操作
程序员文章站
2022-07-13 22:44:28
...
Combobox-lovcombo多选框css和js文件见我的另一篇:https://blog.csdn.net/qq_37279783/article/details/88019873
组件:
var reasonCatStore = new Ext.data.JsonStore({
proxy: new Ext.data.HttpProxy({
method: "POST",
url: "<%=request.getContextPath()%>/problem_getDictByClassId.action?classId=CAUSECLASS"
}),
root: "rows",
fields:['code','name'],
id:"reasonCatStore"
});
//加载数据
reasonCatStore.load();
var reasonCat = {
xtype : 'lovcombo',
fieldLabel : '名称',
labelSeparator : " ",
id : 'reasonCat',
displayField : 'name',
valueField : 'code',
store : reasonCatStore,
mode : 'local',
triggerAction : 'all',
allowBlank:true,
emptyText : '请选择...',
readOnly : true,
name:'reasonCode',
hiddenName:'reasonCode',
anchor : '30%',
//鼠标失去焦点时,输入框为空时加入以下事件
beforeBlur:function () {
var val = this.getCheckedValue();
var dsval = this.getCheckedDisplay();
form_panel.getForm().findField("reasonCode").setValue(val);
form_panel.getForm().findField("reasonCode").setRawValue(dsval);
}
};
上一篇: WPF中设置DataGrid的一些样式
下一篇: React中设置样式style