时间:13-06-07 栏目:EasyUI 作者:zongyan86 评论:0 点击: 4,646 次
本文标签: Combobox
var sValue = $('#selGlade').combobox('getValue'); if (sValue == "") { $.messager.alert("错误", "请选择年级!","info"); return false; }
var DicHandler = "...."; function Combobox(id, type) { $('#' + id).combobox({ url: DicHandler + "&type=" + type, valueField: 'value', textField: 'text', width: 130 }); }
public static List<ComboItem> ComboBox(DataSet ds, string value, string text, bool flag) { List<ComboItem> lst = new List<ComboItem>(); ComboItem item = new ComboItem(); if (flag) { item.text = "<-- 请选择 -->"; item.value = ""; lst.Add(item); } foreach (DataRow dr in ds.Tables[0].Rows) { ComboItem items = new ComboItem(); items.value= dr[value].ToString(); items.text = dr.ToString(); lst.Add(items); } return lst; }
public class ComboItem { public string id { get; set; } public string text { get; set; } }
context.Response.Write(JsonConverter.Parse(EasyJson.ComboBox(ds, "Id", "GradeName", true)));
声明: 本文由( zongyan86 )原创编译,转载请保留链接: EasyUI combobox加入请选择 [.net后台代码]