zoukankan      html  css  js  c++  java
  • jquery easy ui 学习 (8)basic treegrid

    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="UTF-8">
        <title>Basic TreeGrid - jQuery EasyUI Demo</title>
        <link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
        <link rel="stylesheet" type="text/css" href="../../themes/icon.css">
        <link rel="stylesheet" type="text/css" href="../demo.css">
        <script type="text/javascript" src="../../jquery.min.js"></script>
        <script type="text/javascript" src="../../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="700px;height:250px"
                data-options="
                    url: 'treegrid_data1.json',
                    method: 'get',
                    rownumbers: true,
                    idField: 'id',
                    treeField: 'name'
                ">
            <thead>
                <tr>
                    <th data-options="field:'name'" width="220">Name</th>
                    <th data-options="field:'size'" width="100" align="right">Size</th>
                    <th data-options="field:'date'" width="150">Modified Date</th>
                </tr>
            </thead>
        </table>
    
    </body>
    </html>

    json 文件
    [{
        "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"
            }]
        }]
    }]
    
    
  • 相关阅读:
    String分割成int[]和List<Integer>
    linux查询正在运行的jar包并kill进程
    linux自动清理n天(1个月)前日志文件
    zookeeper命令行操作
    sql开窗函数
    hdfs shell操作
    centos7安装mysql8
    hadoop集群安装
    hdfs基本介绍
    IDEA下运行MAVEN项目,报"程序包******不存在"
  • 原文地址:https://www.cnblogs.com/timelesszhuang/p/3686087.html
Copyright © 2011-2022 走看看