树形下拉框实现 mini-treeselect

追求效率,直接进入主题吧…..

效果:

wKioL1WcsmzgJshwAABQgMEGEMc933.jpg


前台代码

<linkhref="../../_frontend/3rd/miniui/miniui.css"rel="stylesheet" />

<scriptsrc="../../_frontend/3rd/miniui/miniui.js"></script>

 

<input class="mini-treeselect" id="ipAJLY"runat="server" url="Data/AjaxService.ashx?method=GetEventSource&userid="textfield="" valuefield="" parentfield=""expand style="width: 100%;" />

 

简析:

Textfield:显示文本值

valuefieldid

parentfield:父类编码

expand 默认全部展开

 

后台代码

需要添加Newtonsoft.Json.dll引用

添加一般处理程序 AjaxService.ashx

public voidProcessRequest(HttpContext context)

        {

            context.Response.ContentType ="text/plain";

            string method =context.Request.GetRequestValueByParam("method");

            if (method.ToLower() == "GetEventSource".ToLower())

            {

                GetEventSource(context);

            }

        }

public voidGetEventSource(HttpContext context)

        {

           DataTable dt = new DataTable();//获取你需要绑定的数据

           context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(dt));//序列化

        }

 

mini-treeselect具体属性方法说明


参考网址:http://www.miniui.com/docs/api/index.html#ui=treeselect


你可能感兴趣的:(树形下拉选择框实现,mini-treeselect)