且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

jstree 禁用复选框

更新时间:2023-11-13 15:47:16

您需要定义一个禁用"类型(使用类型插件),然后将该类型分配给所需的节点.

You will need to define a "disabled" type (using the types plugin) and then assign that type to the desired node.

以这个禁用"的类型定义为例:

Take for instance this "disabled" type definition:

           "types" : {
                "types": {
                "disabled" : { 
                      "check_node" : false, 
                      "uncheck_node" : false 
                    } 
                }
            }

和类型分配:

$.jstree._reference('#tree').set_type("disabled", "#node5");

可以在此处找到有关类型插件的更多信息,您也可以查看这个谷歌群组有更多关于禁用复选框的信息

More info on the types plugin can be found here and you can also check this google group with more info on disabling checkboxes

希望能帮到你!