jsTree 选择独立于层次结构的复选框

Shi*_*mmy 3 javascript checkbox jquery selection jstree

我使用带有复选框的 jsTree,它在选择子节点时检查所有父节点。

有没有办法单独选择每个节点而不考虑层次结构?

现在:

在此输入图像描述

期望:

在此输入图像描述

这是我的代码:

$(function () {
 $('#tree').jstree({
  "checkbox": {
   "two_state": true,
   "real_checkboxes": true,
   //this is supposed to fix it but it doesn't
   "override_ui": true
  },
  "plugins": ["themes", "ui", "checkbox"]
 });
 $('#tree').jstree("hide_icons");
 $('#tree').jstree("hide_dots");   
});
Run Code Online (Sandbox Code Playgroud)

是文档。

sha*_*kib 5

对于GitHub中的当前主版本(2.0.0 alpha),

$(function () {
    $('#demo1').jstree({
        "checkbox": {
            "three_state": false
        },
        "core": {
            "themes": {
                dots: false,
                icons: false
            }
        },
        "plugins": ["html_data", "themes", "ui", "checkbox"]
    });
});
Run Code Online (Sandbox Code Playgroud)

希望这可以帮助。