EasyUI设置Combobx类型 - DaneJiang

前台代码:

<input class="easyui-combobox" name="ProcessType" style="width: 150px;"
                data-options="valueField:'id',textField:'text',url:'GetProcessType',required:'true'" panelHeight="auto" editable="false"/>

后台代码,返回Json格式数据:

public ActionResult GetProcessType()
{
            DataTable dt = DAL.DBConn.GetDataTable("select userid,name from sys_user where userid='A01'");
            var query = from p in dt.AsEnumerable()
                        select new
                        {
                            id = p["userid"].ToString(),
                            text = p["name"].ToString()
                        };

            return Json(query, JsonRequestBehavior.AllowGet);
}

我来评几句
登录后评论

已发表评论数()

相关站点

热门文章