Hi,
I am trying to find the if any of the nodes are checked. I am using var nodes = $("#treeview").igTree("CheckedNodes");
even when no node is checked the var node has length = 1
I have a code which should run only when a node is checked
Am I missing something?
Hello Shreya,
When there are no checked nodes in the igTree, the target element of the tree is returned by the checkedNodes method (to allow method chaining). Therefore in this scenario you may check for instance whether the first element in the returned collection has a particular id to determine whether there are any checked nodes:
$("#tree").igTree("checkedNodes")[0].id != "treeID"
Hope this helps. Please feel free to contact me if you have any questions.
Please feel free to contact me if you have any further questions regarding this matter.