简体   繁体   中英

How to prevent checkbox from being checked when a node is clicked on JSTree?

I don't want the checkbox to be checked when the node is clicked, only when the checkbox itself is clicked. The code below was copied from the JSTree website I think, and I copied a few lines from a tutorial to enable checkboxes.

        $('#ajaxx').jstree({
      'core' : {
        'data' : {
          "url" : (node)=>{
            return node.id === '#' ?
            './dirfilesapi.php?dirID=-1' :
            ('./dirfilesapi.php?dirID='+node.id);
          },
          "dataType" : "json" // needed only if you do not supply JSON headers
        }
      },"checkbox" : {
                        "keep_selected_style" : false
                    },
                    "plugins": ["checkbox"]
    });
"checkbox" : {
    "keep_selected_style" : false , "whole_node": false, "tie_selection": false
},

Solved. I don't remember if it was whole_node or tie_selection that did it. I think it was both, with only whole_node set to false it was working only for either selection or deselection.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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