這篇文章主要介紹了 jstree設置復選框checkbox只允許單選的實現方法
jstree version
console.log($.jstree.version);
3.3.8
多選配置參數: $.jstree.defaults.core.multiple
示例:
$('#demo_tree').jstree({ "core" : { 'data': [ { "id" : "ajson1", "parent" : "#", "text" : "Simple root node"}, { "id" : "ajson2", "parent" : "#", "text" : "Root node 2" }, { "id" : "ajson3", "parent" : "ajson2", "text" : "Child 1" }, { "id" : "ajson4", "parent" : "ajson2", "text" : "Child 2" }, ], "multiple" : false, }, "plugins" : ['checkbox'], });