| 
注册时间2014-7-21最后登录2022-7-26阅读权限150积分18264精华0帖子8338
 
  
 | 
| yx123456 发表于 2017-4-28 15:13  返回来的数据是在一个data里面的,数据是这样的
 A        B      C
 {1年级 1班 小明}
请自行组织数据,树的数据需要数组,可以是树形,可以是列表,但是必须是这两种数据中的一种
 http://www.miniui.com/demo/#src=tree/createtree.html
 就如这示例里面展示的
 1 var list = [                //列表数据,id,pid对应形成父子关系
 { 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" }
 ];
 
 
 2   dataTree = [   //列表数据,children中带出子节点
 { 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" }
 ]
 }
 ];
 | 
 |