博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
easyui的datagrid和treegrid的使用
阅读量:6346 次
发布时间:2019-06-22

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

$('#listTree').treegrid({              idField: 'id',              treeField: 'menuName',              columns: [[                                  { title: 'Task Name', field: 'menuName', width: 180 },                  { field: 'menuUrl', title: 'progress', width: 60, align: 'right' }              ]]                       });          var data = { "total": 3, "rows": [{ "id": 0, "menuName": "管理员首页", "menuUrl": "/main/admin/index.action", "menuPCode": -1, "isLeaf": "0", "status": "1", "icon": "", "createUser": "system", "createDate": "2014-01-24 17:10:25", "modifyUser": "system", "modifyDate": "2014-01-24 17:10:25" }, { "id": 1, "menuName": "修改密码", "menuUrl": "/main/admin/modifyPwd.action", "menuPCode": 0, "isLeaf": "1", "status": "1", "icon": "", "createUser": "system", "createDate": "2014-01-24 17:10:25", "modifyUser": "system", "modifyDate": "2014-01-24 17:10:25", "_parentId": 0 }, { "id": 2, "menuName": "图片上传", "menuUrl": "/image/admin/uploadImage.action", "menuPCode": 1, "isLeaf": "1", "status": "1", "icon": "", "createUser": "system", "createDate": "2014-01-24 17:10:25", "modifyUser": "system", "modifyDate": "2014-01-24 17:10:25", "_parentId": 1 }], "footer": [{ "name": "Total Persons:", "persons": 7, "iconCls": "icon-sum" }] };          $("#listTree").treegrid('loadData', data);          $('#list').datagrid({              width: 1000,              height: 500,              columns: [[                  { title: 'Task Name', field: 'menuName', width: 180 },                  { field: 'menuUrl', title: 'menuUrl', width: 60, align: 'right' }              ]]                    });          var data = { "total": 3, "rows": [{ "id": 0, "menuName": "管理员首页", "menuUrl": "/main/admin/index.action", "menuPCode": -1, "isLeaf": "0", "status": "1", "icon": "", "createUser": "system", "createDate": "2014-01-24 17:10:25", "modifyUser": "system", "modifyDate": "2014-01-24 17:10:25" }, { "id": 1, "menuName": "修改密码", "menuUrl": "/main/admin/modifyPwd.action", "menuPCode": 0, "isLeaf": "1", "status": "1", "icon": "", "createUser": "system", "createDate": "2014-01-24 17:10:25", "modifyUser": "system", "modifyDate": "2014-01-24 17:10:25", "_parentId": 0 }, { "id": 2, "menuName": "图片上传", "menuUrl": "/image/admin/uploadImage.action", "menuPCode": 1, "isLeaf": "1", "status": "1", "icon": "", "createUser": "system", "createDate": "2014-01-24 17:10:25", "modifyUser": "system", "modifyDate": "2014-01-24 17:10:25", "_parentId": 1 }], "footer": [{ "name": "Total Persons:", "persons": 7, "iconCls": "icon-sum" }] };          $("#list").datagrid('loadData', data);

需要注意的是:data的数据,不是json字符串,是json对象

 

转载地址:http://jncla.baihongyu.com/

你可能感兴趣的文章
我的友情链接
查看>>
无线和有线路由哪种性能更好
查看>>
Dwr3.0纯注解(纯Java Code配置)配置与应用浅析三之后端反向调用前端
查看>>
Ubuntu下安装遨游浏览器
查看>>
自定义Linux service脚本
查看>>
微信开发之发红包
查看>>
一键lnmp脚本&&php扩展模块安装(适用于CENTOS6.X系列)
查看>>
二维观察---文字的裁剪
查看>>
矩形覆盖
查看>>
ICMP
查看>>
界面设计模式(第2版)(全彩)
查看>>
解决VMware Workstation错误:未能锁定文件
查看>>
CentOS6 手动编译升级 gcc
查看>>
memcached的安装与开启脚本
查看>>
Linux与Window字符集~~伤不起的幽灵空白符
查看>>
zabbix 邮件报警 -- sendmail
查看>>
JavaScript异步编程
查看>>
tcpdump用法小记
查看>>
MySQL基础安全注意细节
查看>>
Oracle随机函数—dbms_random
查看>>