2023年6月22日发(作者:)
jQuery树控件zTree使⽤⽅法详解(⼀)⼀、节点模糊搜索功能:搜索成功后,⾃动⾼亮显⽰并定位、展开搜索到的节点。⼆、节点异步加载:1、点击展开时加载数据;2、选中节点时加载数据。前台代码如下:js:html:
后台代码(后台返回Json数据): public void SelStudent() { set("getStudentsJsonUrl", to(GetStudentsJson)); } public void GetStudentsJson() { List
> dicList = new List>(); string level = ("level"); string id = ("id"); if (OrEmpty(id)) { #region 加载班级 //获取当前登录⽤户 Sys_User user = inUser(ctx); //获取当前⽤户关联的⽼师 Edu_Teacher teacher = edu_UserId(); //获取班级集合 List list = edu_tByTeacherId(); foreach (Edu_ClaNameFlow item in list) { Dictionary dic = new Dictionary(); ("id", "level0" + ng()); ("pId", "0"); ("name", + ); ("isParent", "true"); (dic); } #endregion } else { if (level == "0") { //加载学⽣ List list = edu_tByClassId(e("level0", "")); foreach (Edu_Student item in list) { Dictionary dic = new Dictionary(); ("id", "level1" + ng()); ("pId", id); ("name", ); ("isParent", "false"); (dic); } } } echoJson(dicList); }更多关于ztree控件的内容,请参考专题 。以上就是本⽂的全部内容,希望对⼤家的学习有所帮助,也希望⼤家多多⽀持。
发布者:admin,转转请注明出处:http://www.yc00.com/xiaochengxu/1687383202a5967.html
评论列表(0条)