EasyUI动态初始话下来框

一种方式是通过查询复制

//查询资产类型 列表
function listAssetType() {
	$.ajax({
		type : "POST",
		url : "../lisType",
		dataType : "json",
		success : function(ret) {
			if (ret.code == 200) {
				$('.valueType').combobox({
					data: ret.data,
					height: 33,
					editable:false,
					panelHeight:'auto',
				    valueField:'typeId',
				    textField:'typeName',
					icons:[{
				           iconCls:'icon-clear',
				           handler:function (e) {
				               $(".valueType").combobox("clear");
				           }
				        }]
				});
			}
		}
	});
}

方法二:直接赋值

function initRepairStatus(){
	$("#repairStatus").combobox({
	    //multiple: true,
	    panelHeight: 'auto',
	    valueField: 'id',//绑定字段ID
	    textField: 'text',//绑定字段Name
	    onLoadSuccess:function(){
	        $(".combo").click(function(){
	                 $(this).prev().combobox("showPanel");
	       });
	   },
	    data:[{
	        "id":"END",
	        "text":"已结单"
	    },{
	        "id":"NOT",
	        "text":"未结单"
	    }],
	    formatter: function (row) {
	        var opts = $(this).combobox('options');
	        return '<input type="checkbox" class="combobox-checkbox" style="margin:0 5px;vertical-align: -2px" id="' + row[opts.valueField] + '">' + row[opts.textField]
	    },
	    //获取数据URL 
	    //选择树节点触发事件 
	    onSelect: function (row) {
	        var opts = $(this).combobox('options');
	        var el = opts.finder.getEl(this, row[opts.valueField]);
	        el.find('input.combobox-checkbox')._propAttr('checked', true);
	    },
	    onUnselect: function (row) {
	        var opts = $(this).combobox('options');
	        var el = opts.finder.getEl(this, row[opts.valueField]);
	        el.find('input.combobox-checkbox')._propAttr('checked', false);
	    }
	})
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值