zoukankan      html  css  js  c++  java
  • ligerTree简单例子

    效果图,如上

    <!DOCTYPE html>
    <html>

    <head>
    <meta charset="UTF-8">
    <title></title>
    <script type="text/javascript" src="../js/jquery.js"></script>
    <script type="text/javascript" src="../js/ligerUi/ligerui.min.js"></script>
    <link rel="stylesheet" href="../css/skins/Aqua/css/ligerui-all.css" />
    <script>
    var treeData = [{
    'name': '节点1',
    'no': 0,
    'text':'哈哈',
    'children': [{
    'name': '节点1.1',
    'no': 1
    },
    {
    'name': '节点1.2',
    'no': 2
    },
    {
    'name': '节点1.3',
    'children': [{
    'name': '节点1.3.1'
    },
    {
    'name': '节点1.3.2'
    }
    ]
    },
    {
    'name': '节点1.4'
    }
    ]
    },
    {
    'name': '节点2','no':'yes'
    }
    ];
    $(function() {
    $("#tree").ligerTree({
    checkbox: false,
    parentIcon: null,
    childIcon: null,
    slide: false, //是否显示动画
    nodeWidth: 100,
    idFieldName: 'id',
    textFieldName: 'name', //指定数据中要显示的属性名,默认为"text"
    data: treeData,
    onSelect: function(node) {
    if(!node.data.name) {
    return
    };
    //处理导航树的点击事件TODO
    alert(node.data.no);
    }
    });
    //var tree = $("#tree").ligerGetTreeManager();
    //tree.setData(treeData) ; //或者这样设值
    });
    </script>
    </head>

    <body>
    <ul id="tree"></ul>
    </body>

    </html>

  • 相关阅读:
    ajax 函数外调用
    a连接 h5点击有背景阴影
    禁止微信上下滑动
    ios 倒计时 不动 例如 2017-09-06 00:24:35
    6-10位 a-z || A-Z ||0-9 正则
    正则 不能输入中文
    正整数正则 (选择商品数量)
    手机号正则
    input输入框只能输入数字而且开头不能为零
    do...while02
  • 原文地址:https://www.cnblogs.com/rdchen/p/11046429.html
Copyright © 2011-2022 走看看