折腾了一会 总算实现用tree 来显示数据, 其他的还在摸索。
这些是json 数据
[{"id":"1","name":"admin","text":"\u540e\u53f0\u5e94\u7528","pid":"0","children":[{"id":"5","name":"Rbac","text":"RBAC\u6743\u9650\u63a7\u5236","pid":"1","children":[{"id":"13","name":"addNode","text":"\u6dfb\u52a0\u8282\u70b9","pid":"5","children":[]},{"id":"12","name":"addRole","text":"\u6dfb\u52a0\u89d2\u8272","pid":"5","children":[]},{"id":"11","name":"addUser","text":"\u6dfb\u52a0\u7528\u6237","pid":"5","children":[]},{"id":"10","name":"node","text":"\u8282\u70b9\u5217\u8868","pid":"5","children":[]},{"id":"9","name":"role","text":"\u89d2\u8272\u5217\u8868","pid":"5","children":[]},{"id":"8","name":"index","text":"\u7528\u6237\u5217\u8868","pid":"5","children":[]}]},{"id":"4","name":"MsgManage","text":"\u8d34\u5b50\u7ba1\u7406","pid":"1","children":[{"id":"7","name":"delete","text":"\u5220\u9664\u5e16\u5b50","pid":"4","children":[]},{"id":"6","name":"Index","text":"\u5e16\u5b50\u5217\u8868","pid":"4","children":[]}]},{"id":"3","name":"Index","text":"\u540e\u53f0\u9996\u9875","pid":"1","children":[{"id":"16","name":"index","text":"\u540e\u53f0\u9996\u9875","pid":"3","children":[]}]}]},{"id":"14","name":"Member","text":"\u4f1a\u5458\u4e2d\u5fc3","pid":"0","children":[]},{"id":"2","name":"Index","text":"\u524d\u7aef\u5e94\u7528","pid":"0","children":[]}]
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/easyui/themes/default/easyui.css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/easyui/themes/icon.css" />
<script type="text/javascript" src="__PUBLIC__/easyui/jquery.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/easyui/locale/easyui-lang-zh_CN.js" ></script>
<script type="text/javascript" src="__PUBLIC__/easyui/jquery.edatagrid.js"></script>
<script type="text/javascript">
$(function(){
$('#tree').tree({
url:"{:U('Rbac/access_read')}",
checkbox:true
});
});
</script>
</head>
<body>
<div id = "tree">
</div>
</body>
</html>