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"
    }
    ]
  • 相关阅读:
    323. Number of Connected Components in an Undirected Graph
    418. Sentence Screen Fitting
    417. Pacific Atlantic Water Flow
    416. Partition Equal Subset Sum
    415. Add Strings
    245. Shortest Word Distance III
    [AHOI2009]维护序列
    [洛谷P1439]排列LCS问题
    [Vijos P1369]难解的问题
    [codevs3657]括号序列
  • 原文地址:https://www.cnblogs.com/hooly/p/8038467.html
Copyright © 2011-2022 走看看