以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 请教老师easyui树所需json生成的问题 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=121171) |
||||
-- 作者:liufucan -- 发布时间:2018/6/30 12:31:00 -- 请教老师easyui树所需json生成的问题 代码见附件。
这段代码可以生成这样的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的那边多处两个空的{}, 不知道怎么去掉?
|
||||
-- 作者:有点蓝 -- 发布时间:2018/6/30 14:08:00 -- 1、e.writestring("[" & jo.ToSTring & "]") 2、没看出是哪里的问题,试试 Dim ps As List(of String) = dt.sqlgetvalues("项目" ,"项目 is not null")
|
||||
-- 作者:liufucan -- 发布时间:2018/6/30 15:22:00 -- 找到问题了,ja2定义应该放在这个位置。 dim ja2 as new jarray ja(i)("children") = ja2 \' |