2 cumtmql CUMTMQL 于 2016.04.05 20:33 提问

json数据转成树结构的问题

求大神指导如何在js端把如下json数据改造成一个树结构在网页中显示出来。
json=[{"children":[{"children":[],"ebtype":"传感器模块","ebuuid":"b9d81030","href":"nodeinfo.j?nodeaddr=-17960","hrefTarget":"_self","ieee":"124B000207EABB","leaf":true,"lqi":"33","mbtype":"电源板","nodeaddr":"-17960","nodeaddr1":"47576","panid":"1231","rssi":"-69"}],"ebtype":"传感器模块","ebuuid":null,"href":"nodeinfo.j?nodeaddr=0","hrefTarget":"_self","ieee":"124B0001A8E7F7","leaf":false,"lqi":"0","mbtype":"智能板","nodeaddr":"0","nodeaddr1":"0","panid":"1231","rssi":"0"}]

3个回答

devmiao
devmiao   Ds   Rxr 2016.04.06 03:52
CSDNXIAON
CSDNXIAON   2016.04.05 20:42

spring 返回 JSON乱码问题的解决 及个人 动态加载ztree树结构的json数据代码
----------------------同志你好,我是CSDN问答机器人小N,奉组织之命为你提供参考答案,编程尚未成功,同志仍需努力!

Royal_lr
Royal_lr   Ds   Rxr 2016.04.06 14:44

可以使用ztree,准备好id,pid,name就行了,,

Csdn user default icon
上传中...
上传图片
插入图片