参考示例: 列表数据生成Tree
<ul id="tree1" class="mini-tree" url="../data/listTree.txt" style="width:200px;padding:5px;" showTreeIcon="true" textField="text" idField="id" parentField="pid" resultAsTree="false" > </ul>
注意:idField、parentField、resultAsTree属性。
通过url返回的数据结构如下:
[ {id: "base", text: "Base", expanded: false}, {id: "ajax", text: "Ajax", pid: "base"}, {id: "json", text: "JSON", pid: "base"}, ...... ]
其中,id和pid对应父子关系。