场景描述:某个公司有多个部门并且部门存在子部门,通过一个下拉框选取多个部门,但是如果某个部门的子部门被全部选择,则只取该部门,而忽略子部门。(叶子节点全被选中时,只取父节点)知识点:ComboTree、一般处理程序、递归、Json效果如图数据库表设计:unit_mainunit_ ...
场景描述:某个公司有多个部门并且部门存在子部门,通过一个下拉框选取多个部门,但是如果某个部门的子部门被全部选择,则只取该部门,而忽略子部门。(叶子节点全被选中时,只取父节点)
知识点:ComboTree、一般处理程序、递归、Json
效果如图
数据库表设计:unit_main
unit_id | unit_name | parent_id | desc |
部门ID | 部门名称 | 父ID | 说明 |
节点类设计:
1 public class Unit 2 { 3 public decimal id { get; set; } 4 public string text { get; set; } 5 public string state { get; set; } 6 public List<Unit> children { get; set; } 7 public Unit () 8 { 9 this.children = new List<Unit>();10 this.state = "open";11 }12 }
原标题:Asp.net下拉树实现(Easy UI ComboTree)
关键词:ASP.NET
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。