jQuery MiniUI
标题:
在mini-treegrid中,如何加载json中节点data的数据?
[打印本页]
作者:
joyoes
时间:
2020-3-24 06:57:18
标题:
在mini-treegrid中,如何加载json中节点data的数据?
本帖最后由 joyoes 于 2020-3-24 07:01 编辑
我参考了
http://miniui.com/demo/#src=treegrid/drawcell.html
的例子,发现从服务器端获取的json格式数据没有像total、msg之类的字段,而是直接加载列表数据,但如果服务器端返回的json数据带到这几个字段时,mini-treegrid要如何设置才能加载data字段下面的json数据啊?
比如服务器返回的json格式数据是:
{
msg:200,
total:100,
data:[{id:1,name:"张三"},{id:2,name:"李四"}]
}
而示例中返回的json格式是这样的:
[{
"UID": "1",
"Name": "项目范围规划",
"Duration": 8,
"Start": "2007-01-01T00:00:00",
"Finish": "2007-01-10T00:00:00",
"PercentComplete": 0,
"Summary": 1,
"Critical": 0,
"Milestone": 0,
"PredecessorLink": [],
"ParentTaskUID": -1
},
{
"UID": "2",
"Name": "确定项目范围",
"Duration": 1,
"Start": "2007-01-01T00:00:00",
"Finish": "2007-01-01T23:23:59",
"PercentComplete": 30,
"Summary": 0,
"Critical": 0,
"Milestone": 0,
"PredecessorLink": [],
"ParentTaskUID": "1"
}]
复制代码
作者:
felt
时间:
2020-3-24 13:22:58
dataField="data" resultAsTree="false" idField="UID“ parentField="ParentTaskUID"
id/pid字段按你数据里面的对应字段来
欢迎光临 jQuery MiniUI (http://miniui.com/discuss/)
Powered by Discuz! X2