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的checkbox默认隐藏

 

jstree version => 3.3.8

相关文章:

  • 2022-12-23
  • 2022-02-03
  • 2021-10-16
  • 2022-01-28
  • 2021-08-17
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2019-12-26
  • 2021-12-02
  • 2022-12-23
  • 2022-12-23
  • 2021-12-24
  • 2021-11-05
  • 2022-12-23
相关资源
相似解决方案