easyui tree 显示数据

博主成功实现了通过EasyUI的Tree组件展示JSON数据,目前仍在深入研究其他功能。
摘要由CSDN通过智能技术生成

折腾了一会 总算实现用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>


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值