首页 > 代码库 > easyui conbox动态绑定

easyui conbox动态绑定

 

  前台 格式化控件

 $("#CustomerNo").combobox({
                valueField:‘Value‘,    
                 textField:‘Text‘,  
                 panelHeight:‘auto‘,
                 editable:false
             });

  后台取值

 var selectItems = new List<SelectListItem>();

                List<CustomerModel> lst = _DeliveryListService.Get_receipt_CustomerInfo(ReceiptNo);
               
                foreach (CustomerModel item in lst)
                {
                    selectItems.Add(new SelectListItem { Text = item.CustomerNm, Value = http://www.mamicode.com/item.CustomerNo.ToString() });"用户信息查看:" + "修改成功:" + LoginUser.UserID;
                addLog(0, 1, msg, VarKey.ServicePage.UserInfoManager.ToString());
                return Json(new { result = 1, Customer = selectItems, Msg = BaseRes.USE_MSG_015 });// "修改成功!"
            }

  前台绑定

$(‘#CustomerNo‘).combobox("loadData",packJson.Customer);

  

 

easyui conbox动态绑定