How can I make the node expand/collapse when the user clicks on the parent node text and not just on the expander triangle?
I tried adding:
nodeClick: function(evt, ui) { $("#myTree").igTree("toggle", ui.node); }
But it gives me the error: "TypeError: node.children is not a function"
Obviously I'm doing something wrong.
Hello Pete,
Thank you for contacting Infragistics!
Please let us know if you need further assistance.
Hi Pete,
There is a difference where we say "jQuery object of the node element" and "node object". But I can see how this can be confusing so we would think about a way to make this more explicit. We have a function for creating a node object using the node element which is the nodeFromElement but other than that it's kind of hard to distinguish between the two from a documentation point of view. We will definitely look into this.
Thank you for the feedback!
Do you think, someone could update the documentation to correctly reflect that you need to pass the element instead of the node?
http://help.infragistics.com/jQuery/2012.1/ui.igtree
ui.node refers to a node object which contains the element, data and path of the node. The toggle function takes the element as a parameter so change to:
nodeClick: function(evt, ui) {
$("#myTree").igTree("toggle", ui.node.element);
}
Let me know if you need any additional help!