代码见附件。
这段代码可以生成这样的json数据:
{ "id": "1", "text": "全部", "state": "closed", "children": [ { "id": "2", "text": "东盛华庭B区", "children": [ { "id": "6", "text": "待审核" }, { "id": "7", "text": "已审核" }, {}, {} ] }, { "id": "3", "text": "东盛华庭A区", "children": [ { "id": "4", "text": "待审核" }, { "id": "5", "text": "已审核" } ] } ] }
两个问题:
1、easyui所需json头尾需要[],怎么办?
2、id为7的那边多处两个空的{}, 不知道怎么去掉?