zoukankan      html  css  js  c++  java
  • easyUI带复选框的组合树

    代码:
    
    <input id="depts">
    <script type="text/javascript">
    $(document).ready(function() {
    $('#depts').combotree({
    url: 'data/depts.json',
    multiple:true,//复选框
    checkbox:true,//
    cascadeCheck:false//true:选中父节点后下面的所有子节点选中,false:选中父节点后下面的子节点不选中
    });
    });
    </script>
    
    或者
    <input id="depts" name="depts" class="easyui-combotree" data-options="url:'data/depts.json',method:'get',required:true,multiple:true,checkbox:true,cascadeCheck:true">

    depts.json模拟数据:
    
    [
    {
    "children": [
    {
    "id": "11",
    "text": "二级部门1"
    },{
    "id": "12",
    "text": "二级部门2"
    },{
    "id": "13",
    "text": "二级部门3"
    },{
    "id": "14",
    "text": "二级部门4"
    }
    ],
    "icoCls": "icon-ok",
    "id": "1",
    "state": "closed",
    "text": "部门1"
    },
    {
    "children": [
    {
    "id": "21",
    "text": "二级部门5"
    }
    ],
    "icoCls": "icon-ok",
    "id": "2",
    "state": "closed",
    "text": "部门2"
    },
    {
    "children": [
    {
    "id": "31",
    "text": "二级部门6"
    },
    {
    "id": "32",
    "text": "二级部门7"
    },
    {
    "id": "33",
    "text": "二级部门8"
    }
    ],
    "icoCls": "icon-ok",
    "id": "3",
    "state": "closed",
    "text": "部门3"
    }
    ]
  • 相关阅读:
    js键盘事件以及键盘事件拦截
    JavaScript 延迟加载
    二叉树深度优先 求二叉树最大深度
    css 小知识点:inline/inline-block/line-height
    es6 set
    CSS 水平垂直居中
    js 位运算符
    js 函数重载
    js之单例模式
    js 面向对象 ES5 AND ES6
  • 原文地址:https://www.cnblogs.com/hooly/p/8038467.html
Copyright © 2011-2022 走看看