ligerComboBox项目中运用总结内容如下:
$("#selectId").ligerComboBox({ data: proData, initValue: 0});这就默认选择第一项了。
ligerComboBox运用案例:
$("#yylx").ligerComboBox({
resize: false,
width: 170,
valueField: ‘num‘,
textField: ‘name‘,
url: ‘../ashx/wsyy.ashx?action=loadyylx&Math=‘ + Math.random(),
initValue:0
});
一般处理程序:
DataTable dt = new BLL.yylx().GetList("").Tables[0];
StringBuilder strJson = new StringBuilder();
JsonWriter writer = new JsonWriter(strJson);
writer.WriteArrayStart();
writer.WriteObjectStart();
writer.WritePropertyName("yylx_num");
writer.Write("0");
writer.WritePropertyName("yylx_name");
writer.Write("--全部--");
writer.WriteObjectEnd();
foreach (DataRow dr in dt.Rows)
{
writer.WriteObjectStart();
writer.WritePropertyName("num");
writer.Write(dr["num"].ToString());
writer.WritePropertyName("name");
writer.Write(dr["name"].ToString());
writer.WriteObjectEnd();
}
writer.WriteArrayEnd();
context.Response.Write(strJson.ToString());
context.Response.End();