如何使用jsTree设置复选框

How do I set up checkboxes with jsTree?

本文关键字:复选框 设置 jsTree 何使用      更新时间:2023-09-26

我想使用带有复选框的jsTree,但它不起作用。

我的代码:

$("#tree").jstree({
    "json_data" : {
        "data" : data
    },
    checkbox: true,
    checkboxName: 'checkbox1[]',
    "plugins" : [ "themes", "json_data", "ui", "checkbox", "types" ]
});

这棵树看起来不错,很管用,但我没有复选框来选择项目。

有人能帮忙吗?

这可能会对您有所帮助。:)

$("#tree").jstree({
"plugins" : ["themes","json_data","ui","checkbox", "types"],
"json_data":{
    data : data
},
"checkbox": {
    two_state: true
}});