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?
Hi there,
This behavior has been corrected and now the API methods for checkedNodes, partiallyCheckedNodes and uncheckedNodes correctly return an empty array when the collection is empty, instead of returning the default which is the widget element.
Thank you for using the Infragistics forums!
Hello Shreya,
Please feel free to contact me if you have any further questions regarding this matter.
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.