EXTJS2.2组件Combobox-lovcombo多选框操作

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_37279783/article/details/88019967

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);
        }
    };

猜你喜欢

转载自blog.csdn.net/qq_37279783/article/details/88019967