简体   繁体   English

如何使用jsTree设置复选框?

[英]How do I set up checkboxes with jsTree?

I want to use jsTree with checkboxes but it does not work. 我想将jsTree与复选框一起使用,但不起作用。

My code: 我的代码:

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

The tree looks nice and works, but I don't have the checkboxes to select items. 这棵树看起来不错并且可以工作,但是我没有选择项目的复选框。

Can anybody help? 有人可以帮忙吗?

This might help you. 这可能对您有帮助。 :) :)

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM