博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
EasyUI TreeGrid
阅读量:4969 次
发布时间:2019-06-12

本文共 3156 字,大约阅读时间需要 10 分钟。

参考官方地址:

 

 一个基础的TReeGrid的示例展示

json返回的格式如下:json里面嵌套children格式

[{    "id":1,    "name":"C",    "size":"",    "date":"02/19/2010",    "children":[{        "id":2,        "name":"Program Files",        "size":"120 MB",        "date":"03/20/2010",        "children":[{            "id":21,            "name":"Java",            "size":"",            "date":"01/13/2010",            "state":"closed",            "children":[{                "id":211,                "name":"java.exe",                "size":"142 KB",                "date":"01/13/2010"            },{                "id":212,                "name":"jawt.dll",                "size":"5 KB",                "date":"01/13/2010"            }]        },{            "id":22,            "name":"MySQL",            "size":"",            "date":"01/13/2010",            "state":"closed",            "children":[{                "id":221,                "name":"my.ini",                "size":"10 KB",                "date":"02/26/2009"            },{                "id":222,                "name":"my-huge.ini",                "size":"5 KB",                "date":"02/26/2009"            },{                "id":223,                "name":"my-large.ini",                "size":"5 KB",                "date":"02/26/2009"            }]        }]    },{        "id":3,        "name":"eclipse",        "size":"",        "date":"01/20/2010",        "children":[{            "id":31,            "name":"eclipse.exe",            "size":"56 KB",            "date":"05/19/2009"        },{            "id":32,            "name":"eclipse.ini",            "size":"1 KB",            "date":"04/20/2010"        },{            "id":33,            "name":"notice.html",            "size":"7 KB",            "date":"03/17/2005"        }]    }]}]
View Code

 

另外的一种json返回格式:

它的json格式如下:注意返回的格式_parentId对应的是tree的父节点的id,通过指定父节点的id让 grid来自动的识别父节点和子节点

 

{  "total": 7,  "rows": [    {      "id": 1,      "name": "All Tasks",      "begin": "3/4/2010",      "end": "3/20/2010",      "progress": 60,      "iconCls": "icon-ok"    },    {      "id": 2,      "name": "Designing",      "begin": "3/4/2010",      "end": "3/10/2010",      "progress": 100,      "_parentId": 1,      "state": "closed"    },    {      "id": 21,      "name": "Database",      "persons": 2,      "begin": "3/4/2010",      "end": "3/6/2010",      "progress": 100,      "_parentId": 2    },    {      "id": 22,      "name": "UML",      "persons": 1,      "begin": "3/7/2010",      "end": "3/8/2010",      "progress": 100,      "_parentId": 2    },    {      "id": 23,      "name": "Export Document",      "persons": 1,      "begin": "3/9/2010",      "end": "3/10/2010",      "progress": 100,      "_parentId": 2    },    {      "id": 3,      "name": "Coding",      "persons": 2,      "begin": "3/11/2010",      "end": "3/18/2010",      "progress": 80    },    {      "id": 4,      "name": "Testing",      "persons": 1,      "begin": "3/19/2010",      "end": "3/20/2010",      "progress": 20    }  ],  "footer": [    {      "name": "Total Persons:",      "persons": 7,      "iconCls": "icon-sum"    }  ]}
View Code

 

 

 

 

转载于:https://www.cnblogs.com/wangjunwei/p/3514010.html

你可能感兴趣的文章
Java回顾之多线程
查看>>
机电行业如何进行信息化建设
查看>>
9、总线
查看>>
Git 笔记 - section 1
查看>>
2018 Multi-University Training Contest 10 - Count
查看>>
HDU6203 ping ping ping
查看>>
《人人都是产品经理》书籍目录
查看>>
如何在git bash中运行mysql
查看>>
OO第三阶段总结
查看>>
构建之法阅读笔记02
查看>>
DataTable和 DataRow的 区别与联系
查看>>
检索COM 类工厂中CLSID 为 {00024500-0000-0000-C000-000000000046}的组件时失败
查看>>
mysql数据库中数据类型
查看>>
Fireworks基本使用
查看>>
Linux 标准 I/O 库
查看>>
.net Tuple特性
查看>>
Java基础常见英语词汇
查看>>
nginx启动、关闭命令、重启nginx报错open() "/var/run/nginx/nginx.pid" failed
查看>>
BZOJ 3097 Hash Killer I
查看>>
UINavigationController的视图层理关系
查看>>