創(chuàng)建樹(shù):列表結(jié)構(gòu)

參考示例: 列表數(shù)據(jù)生成Tree
創(chuàng)建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屬性。
數(shù)據(jù)結(jié)構(gòu):列表
通過(guò)url返回的數(shù)據(jù)結(jié)構(gòu)如下:
[ {id: "base", text: "Base", expanded: false}, {id: "ajax", text: "Ajax", pid: "base"}, {id: "json", text: "JSON", pid: "base"}, ...... ]其中,id和pid對(duì)應(yīng)父子關(guān)系。