[{ "id":1, "text":"评分项目", "children":[{ "id":11, "text":"项目一", "state":"closed", "children":[{ "id":111, "text":"项目分支1", "state":"closed", "children":[{ "id":1111, "text":"项目底层" }] },{ "id":112, "text":"项目分支2", "state":"closed", "children":[{ "id":1121, "text":"项目底层" }] }] },{ "id":12, "text":"项目二", "state":"closed", "children":[{ "id":121, "text":"尺寸", "state":"closed", "children":[{ "id":1211, "text":"方向" },{ "id":1212, "text":"方向2" },{ "id":1213, "text":"距离" },{ "id":1214, "text":"距离2" }] }] } }]
前台设定载入代码如下: $(function () { $('#BiaoZhun').tree({ url: 'BiaoZhunTree.ashx', // loadFilter: function(data){ // if (data.d){ // return data.d; // } else { // return data; // } //} }); });
网页DOM节点设置如下:
XML/HTML code?12 <ul id="BiaoZhun"></ul> 1.json倒数第二个符号'}'改为'}]' 2.URL后面的','去掉(因为后面的代码被你注释了)
|