Toggle checked on <li> click
Great plugin btw :) I want to toggle checked, when i click on span that is inside
oh, It's so easy.
Please use the callback.onClick. when user click the node's name, zTree will trigger this function.
In this function, you can check the node with 'checkNode()' function.
When you say callback onClick, i need to add to settings callback: { onClick: myFunction } And in myFunction to toggle checked? Maybe i am trying to implement this plugin to fast, i need to check API better :)
yes, in myFunction, you can get the ‘treeId’ & ‘treeNode' parameters ....so you can use
treeObj.checkNode(treeNode, !treeNode.checked);
please check the API & Demo