Jquery 嵌套集和树视图控件

Jquery 嵌套集和树视图控件,jquery,sql,sql-server,asp.net-mvc,tsql,Jquery,Sql,Sql Server,Asp.net Mvc,Tsql,给定以下数据库表和示例数据: Locations Id ParentId LeftIndex RightIndex Description -- -------- --------- ---------- ----------- 34 2 85 104 Florida Region 73 34 94 95 Miami Products Id ParentLocationId

给定以下数据库表和示例数据:

Locations
Id  ParentId  LeftIndex  RightIndex  Description
--  --------  ---------  ----------  -----------
34  2         85         104         Florida Region
73  34        94         95          Miami

Products
Id  ParentLocationId  Code  Description
--  ----------------  ----  -----------
1   73                MIW0  Miami Magazines
我正在为层次结构数据使用嵌套集。我想做的是在一个可折叠的树状视图控件中显示我的位置和产品。在继续之前,我是否需要合并这些表?请告知所有区域(见标签)

谢谢


rod.

我建议您创建一个模型视图,将域模型映射到控制器中。比如说

public class TreeViewEntry {
    public string Name { get; set; }
    public TreeViewEntry[] Children { get; set; }
}
然后在本页中查看jQuery插件和HTML帮助程序: