要实现无限级部门结构的联动 表结构为 id text parentid 请问如何生成treepanel所要的json格式的数据 [
{id:'01',text:'01',children:[
{id:'01-01',text:'01-01',leaf:true},
{id:'01-02',text:'01-02',children:[
{id:'01-02-01',text:'01-02-01',leaf:true},
{id:'01-02-02',text:'01-02-02',leaf:true}
]},
{id:'01-03',text:'01-03',leaf:true}
]},
{id:'02',text:'02',leaf:true}
]
{id:'01',text:'01',children:[
{id:'01-01',text:'01-01',leaf:true},
{id:'01-02',text:'01-02',children:[
{id:'01-02-01',text:'01-02-01',leaf:true},
{id:'01-02-02',text:'01-02-02',leaf:true}
]},
{id:'01-03',text:'01-03',leaf:true}
]},
{id:'02',text:'02',leaf:true}
]
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货