- 注册时间
 - 2016-2-17
 - 最后登录
 - 2023-10-19
 - 阅读权限
 - 10
 - 积分
 - 942
 - 精华
 - 0
 - 帖子
 - 127
  
 
 
 
  
 | 
dforce 发表于 2019-1-17 17:57   
http://www.miniui.com/demo/#src=tree/createtree.html 
参考示例,根据你的数据的格式,对应使用不同的加 ...  
tree.loadList(data,"id","pid") 遇上有孙子节点的貌似不行。 
我的数据源不是以下类型: 
 var dataTree = [ 
            { id: "lists", text: "Lists", expanded: false, 
                children: [ 
                                { id: "datagrid", text: "DataGrid" }, 
                                { id: "tree", text: "Tree" }, 
                                { id: "treegrid", text: "TreeGrid " } 
                        ] 
            }, 
                { id: "layouts", text: "Layouts", expanded: false, 
                    children: [ 
                                { id: "panel", text: "Panel" }, 
                                { id: "splitter", text: "Splitter" }, 
                                { id: "layout", text: "Layout " } 
                        ] 
                }, 
                { id: "navigations", text: "Navigations", expanded: false, 
                    children: [ 
                                { id: "pager", text: "Pager" }, 
                                { id: "tabs", text: "Tabs" }, 
                                { id: "navbar", text: "NavBar" }, 
                                { id: "menu", text: "Menu" } 
                        ] 
                } 
        ]; 
 
而是这种类型: var list = [ 
                { id: "base", text: "Base" },             
                { id: "ajax", text: "Ajax", pid: "base" }, 
                { id: "json", text: "JSON", pid: "base" }, 
                { id: "date", text: "Date", pid: "base" }, 
                { id: "control", text: "Control", pid: "base" }, 
                { id: "forms", text: "Forms", pid: "base" }, 
                { id: "button", text: "Button", pid: "forms" }, 
                { id: "listbox", text: "ListBox", pid: "forms" }, 
                { id: "checkboxlist", text: "CheckBoxList", pid: "forms" }, 
            { id: "lists", text: "Lists" }, 
                { id: "datagrid", text: "DataGrid", pid: "lists" }, 
                { id: "tree", text: "Tree", pid: "lists" }, 
                { id: "treegrid", text: "TreeGrid ", pid: "lists" } 
        ]; 
 
 
有什么好的解决方案吗? |   
 
  
 |