Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
220
$("#treeview").igTree("CheckedNodes") issue
posted


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?

Parents
No Data
Reply
  • 49378
    Verified Answer
    posted

    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.

Children