jqGrid行数据中如何添加下来选select

columnModel: [
	//Ajax查询,动态赋值,表单不能编辑
	{header:'${text("对象")}', name:'', width:150, editable:false, edittype:'select',formatter : 'select', editoptions:{'class':'form-control',value:getObjectList()}},
	//取字典
	{header:'${text("状态")}', name:'', width:100,
		editable:true, edittype:'select', editoptions:{'class':'form-control',
			items: $.merge([{dictLabel:' ',dictValue:''}], ${@DictUtils.getDictListJson('use_status')}),
			itemLabel: 'dictLabel', itemValue: 'dictValue', dataInit: function(element){
				$(element).select2().on("change",function(){$(this).valid()});
			}
		}
	},
],

    /*获取对象下拉选*/
    function getObjectList() {
        var strObjectList="";
        $.ajax({
            type:"post",
            async:false,
            url:"${ctx}/xxx/xxx/xxx/findObjectList",
            data: {
            },
            success:function(data){
                if (data.length>0) {
                    strObjectList += ""+":"+"请xuanze"+";";
                    for(var i = 0; i<data.length; i++){
                        if(i != length - 1){
                            strObjectList += data[i].id+":"+data[i].institutionName+";";
                        }else{
                            strObjectList += data[i].id+":"+data[i].institutionName;
                        }
                    }
                    strObjectList = strObjectList.substring(0,strObjectList.length -1);
                }
            }
        });
        return strObjectList;
    }
	

猜你喜欢

转载自blog.csdn.net/qq_39822451/article/details/89414234