easyUI treegrid 不显示

protection666 2018-03-24 11:40:41
这个是jsp页面
<%@ page language="java" contentType="text/html; UTF-8" pageEncoding="UTF-8" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="keywords" content="jquery,ui,easy,easyui,web">
<meta name="description" content="easyui help you build your web page easily!">
<title>jQuery EasyUI Demo</title>
<link rel="stylesheet" type="text/css" href="http://www.jeasyui.net/Public/js/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="http://www.jeasyui.net/Public/js/easyui/themes/icon.css">
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="http://www.jeasyui.net/Public/js/easyui/jquery.easyui.min.js"></script>
</head>
<body>
<h2>Basic TreeGrid</h2>
<p>TreeGrid allows you to expand or collapse group rows.</p>
<div style="margin:20px 0;"></div>
<table title="Folder Browser" class="easyui-treegrid" style="width:700px;height:250px"
data-options="
url: '<%=basePath%>admin/model/getModelList.action',
method: 'get',
rownumbers: true,
idField: 'id',
treeField: 'name'
">
<thead>
<tr>
<th data-options="field:'name'" width="220">Name</th>
<th data-options="field:'URL'" width="100" align="right">Size</th>
</tr>
</thead>
</table>

</body>
</html>
这个是后台传回的数据
[{"children":[{"URL":"admin/adminUser/index.action","id":2,"name":"管理员管理","orderId":71,"roleType":1},{"URL":"admin/role/index.action","id":3,"name":"角色管理","orderId":72,"roleType":1},{"URL":"/admin/model/modellist.action","id":128,"name":"菜单管理","orderId":136,"roleType":1}],"id":1,"name":"系统管理","orderId":1,"roleType":1},{"children":[{"URL":"term/jumpPage.action?operting=view/terminal/agentManager/agentOutTerm","id":80,"name":"商户終端","orderId":13,"roleType":2},{"URL":"term/jumpPage.action?operting=view/terminal/agentManager/agentOutTermToOne","id":104,"name":"代理商终端","orderId":112,"roleType":2},{"URL":"term/jumpPage.action?operting=view/terminal/agentManager/termStatusInfoOne","id":82,"name":"终端管理","orderId":113,"roleType":2},{"URL":"term/jumpPage.action?operting=view/terminal/termFlowTmp/termFlowTmpByAgent","id":109,"name":"终端审批回退","orderId":117,"roleType":2},{"URL":"term/jumpPage.action?operting=view/terminal/agentManager/termStatusInfoTwo","id":83,"name":"终端管理","orderId":120,"roleType":2}],"id":56,"name":"终端管理","orderId":1,"roleType":2},{"children":[{"URL":"admin/adv/index.action","id":6,"name":"广告审核","orderId":41,"roleType":1},{"URL":"admin/sysConfig/servingStatus.action","id":7,"name":"广告投放策略","orderId":42,"roleType":1},{"URL":"admin/profitConfig/index.action","id":8,"name":"分润设置","orderId":43,"roleType":1},{"URL":"admin/industry/index.action","id":9,"name":"行业管理","orderId":44,"roleType":1},{"URL":"admin/getAdvManageList.action","id":10,"name":"平台广告管理","orderId":45,"roleType":1},{"URL":"admin/message/index.action","id":12,"name":"消息中心","orderId":46,"roleType":1},{"URL":"admin/sysConfig/termTime.action","id":86,"name":"终端播放设置","orderId":47,"roleType":1},{"URL":"admin/article/index.action","id":94,"name":"文章管理\r\n","orderId":48,"roleType":1},{"URL":"term/jumpPage.action?operting=view/terminal/termSetMoney","id":96,"name":"终端价格设置","orderId":106,"roleType":1}],"id":5,"name":"运营管理","orderId":2,"roleType":1},{"children":[{"URL":"agent/skipNewAgent.action?operting=view/agent/agentManager/QryListAgentAdv","id":66,"name":"广告主管理","orderId":6,"roleType":2},{"URL":"agent/skipNewAgent.action?operting=view/agent/agentManager/QryAgentUser","id":84,"name":"商户管理","orderId":15,"roleType":2},{"URL":"agent/toQRCodeMarketing.action","id":98,"name":"代理商推广","orderId":17,"roleType":2},{"URL":"agent/indexUser.action?merType=04","id":34,"name":"商户审批回退","orderId":81,"roleType":2},{"URL":"agent/qryListAgentOne.action","id":100,"name":"二级代理商管理","orderId":108,"roleType":2},{"URL":"agent/indexUser.action?merType=06","id":101,"name":"二级商户审核","orderId":109,"roleType":2}],"id":58,"name":"代理商管理","orderId":2,"roleType":2},{"URL":"","children":[{"URL":"term/jumpPage.action?operting=view/terminal/findtermInfo","id":18,"name":"入库管理","orderId":73,"roleType":1},{"URL":"term/jumpPage.action?operting=view/terminal/findOutTermInfo","id":26,"name":"出库管理","orderId":77,"roleType":1},{"URL":"term/jumpPage.action?operting=view/terminal/termStatusInfo","id":28,"name":"终端状态管理","orderId":78,"roleType":1},{"URL":"term/jumpPage.action?operting=view/terminal/templateManager","id":97,"name":"模版管理","orderId":107,"roleType":1},{"URL":"term/jumpPage.action?operting=view/terminal/termFlowTmp/termFlowTmp","id":108,"name":"终端审核","orderId":116,"roleType":1}],"id":4,"name":"终端管理","orderId":3,"roleType":1},{"children":[{"URL":"agent/order/index.action","id":68,"name":"订单管理","orderId":7,"roleType":2},{"URL":"agent/profitConfig/oneLevelAgent.action","id":102,"name":"分润设置","orderId":110,"roleType":2},{"URL":"agent/profitConfig/twoLevelAgent.action","id":103,"name":"二级分润设置","orderId":111,"roleType":2},{"URL":"term/jumpPage.action?operting=view/terminal/terminfosub/termInfoProfit","id":107,"name":"终端分润设置","orderId":115,"roleType":2}],"id":60,"name":"交易管理","orderId":3,"roleType":2},{"children":[{"URL":"admin/getOrderPage.action","id":14,"name":"订单管理","orderId":51,"roleType":1},{"URL":"admin/sysConfig/orderDisTime.action","id":15,"name":"订单设置","orderId":52,"roleType":1}],"id":13,"name":"交易管理","orderId":4,"roleType":1},{"children":[{"URL":"agent/finance/index.action?idenType=agent","id":70,"name":"代理商对账","orderId":8,"roleType":2},{"URL":"agent/finance/index.action?idenType=mer","id":72,"name":"商户对账","orderId":9,"roleType":2},{"URL":"agent/finance/tardRecordIndex.action","id":74,"name":"交易记录","orderId":10,"roleType":2},{"URL":"agent/order/withdrawIndex.action","id":76,"name":"提现管理","orderId":11,"roleType":2},{"URL":"agent/order/bankCardList.action","id":88,"name":"账户管理","orderId":16,"roleType":2}],"id":62,"name":"财务管理","orderId":4,"roleType":2},{"URL":"","children":[{"URL":"agent/qryListAgent.action","id":20,"name":"代理商管理","orderId":74,"roleType":1},{"URL":"agent/indexUser.action?merType=01","id":22,"name":"广告主管理","orderId":75,"roleType":1},{"URL":"Auser/userlist.action","id":23,"name":"会员管理","orderId":76,"roleType":1},{"URL":"agent/auditAgent.action","id":30,"name":"代理商审核","orderId":79,"roleType":1},{"URL":"agent/indexUser.action?merType=05","id":36,"name":"商户管理","orderId":80,"roleType":1},{"URL":"agent/indexUser.action?merType=03","id":32,"name":"商户审核","orderId":82,"roleType":1}],"id":16,"name":"代理商管理","orderId":5,"roleType":1},{"children":[{"URL":"finance/indexFinance.action?merType=01","id":46,"name":"平台对账","orderId":99,"roleType":1},{"URL":"finance/indexFinance.action?merType=02","id":48,"name":"代理商对账","orderId":100,"roleType":1},{"URL":"finance/merchantAccountList.action","id":50,"name":"商户对账","orderId":101,"roleType":1},{"URL":"finance/generalAccountList.action","id":52,"name":"普通用户对账","orderId":102,"roleType":1},{"URL":"finance/tradeRecordList.action","id":54,"name":"交易记录","orderId":103,"roleType":1},{"URL":"finance/getWithdrawPage.action","id":55,"name":"提现记录","orderId":104,"roleType":1},{"URL":"finance/invoiceManagementList.action","id":92,"name":"发票管理","orderId":105,"roleType":1},{"URL":"record/index.action?operting=view/finance/record/agentRecordList","id":119,"name":"代理商交易记录","orderId":127,"roleType":1},{"URL":"record/index.action?operting=view/finance/record/userRecordList","id":120,"name":"用户交易记录","orderId":128,"roleType":1},{"URL":"web/chanpay/toApplyListPage.action","id":121,"name":"畅捷支付代理商管理","orderId":129,"roleType":1}],"id":44,"name":"财务管理","orderId":6,"roleType":1},{"URL":"","children":[{"URL":"redis/toRedisPlayPlan.action","id":99,"name":"redis播放计划","orderId":49,"roleType":1},{"URL":"term/jumpPage.action?operting=view/sys/setSysTypes","id":106,"name":"系统属性配置","orderId":114,"roleType":1}],"id":105,"name":"后台运维","orderId":113,"roleType":1},{"children":[{"URL":"term/jumpPage.action?operting=view/admin/account/acAdManager","id":110,"name":"账户充值","orderId":118,"roleType":1},{"URL":"admin/coupons/setCoupons.action","id":111,"name":"券模板设置","orderId":119,"roleType":1},{"URL":"finance/toAccountList.action","id":113,"name":"账户查询","orderId":121,"roleType":1}],"id":112,"name":"账户管理","orderId":120,"roleType":1},{"children":[{"id":115,"name":"百度互联网广告","orderId":123,"roleType":1},{"URL":"adsys/editAdPrice.action","id":118,"name":"广告价格设置","orderId":126,"roleType":1}],"id":114,"name":"互联网广告管理","orderId":122,"roleType":1},{"children":[{"URL":"/agent/finance/index.action?idenType=twoAgent","id":123,"name":"二级代理分润设置","orderId":131,"roleType":2},{"URL":"/agent/finance/index.action?idenType=agentStore","id":124,"name":"商户分润设置","orderId":132,"roleType":2}],"id":122,"name":"分润设置","orderId":130,"roleType":2},{"children":[{"id":125,"name":"订单系统管理","orderId":133,"roleType":1},{"id":130,"name":"账务系统管理","orderId":138,"roleType":1}],"id":129,"name":"企业版","orderId":137,"roleType":1}]

页面显示


json在线解析数据没问题啊

求助啊
...全文
611 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
weixin_36067256 2018-04-12
  • 打赏
  • 举报
回复
json最后一层封装的不对,应该是{"total":**,"rows":[]}
xwn_2016 2018-03-27
  • 打赏
  • 举报
回复
别整成树结构,直接把数据放一个list里
Sunyiban 2018-03-24
  • 打赏
  • 举报
回复
你直接把这个返回的JSON写死 ,直接引入进去看看能不能展示

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧