• jstree的checkbox默认隐藏


    jstree复选框自定义显示隐藏

    jstree 本身不支持在节点中隐藏 checkbox,国外有个大佬给出一个利用 css 来隐藏的解决方案:

    首先来一段 css

    .no_checkbox>i.jstree-checkbox{display:none}

    然后在 data 的 json 数据结构中

    $('#demo_tree').jstree({
        "core" : {
            'data': [
               { "id" : "ajson1", "parent" : "#", "text" : "Simple root node", state: {checked: true}},
               { "id" : "ajson2", "parent" : "#", "text" : "Root node 2" },
               { "id" : "ajson3", "parent" : "ajson2", "text" : "Child 1" , a_attr: {class: "no_checkbox"}},
               { "id" : "ajson4", "parent" : "ajson2", "text" : "Child 2" },
            ]
        },
        "plugins" : ['checkbox'],
    });

    效果:

    jstree version => 3.3.8

    作者:逆舟
    https://www.cnblogs.com/zy-jiayou/
    本博客文章均为作者原创,转载请注明作者和原文链接。
  • 相关阅读:
    hdu
    HUNAN 11567 Escaping (最大流)
    poj -1185 炮兵阵地 (经典状压dp)
    poj
    POJ 2955 Brackets (区间dp)
    csu
    poj
    CSU 1116 Kingdoms
    SPOJ-SQRBR Square Brackets
    退役贴
  • 原文地址:https://www.cnblogs.com/zy-jiayou/p/12162277.html
Copyright © 2020-2023  润新知