Team,
Is there a way to allow only 2 levels deep for nodes? I need parent and child only. I have tried explicitly checking for existence of a parent node and parent.parent node but that doesn't seem to work.
Any ideas?
-Mark
Hello Mark,Thank you for contacting Infragistics Developer Support!
Could you specify what do you mean by two levels deep for nodes? If you provide a code sample will be better.Thank you in advance!
Denis,
In this case, I think an image would work better.
I would like there to be only root level and children, disallowing the insertion of children to children. In essence, a map of level 0 and 0_0 but nothing at level 0_0_0. Should I just check for path separators? Is there a more elegant way?
In case the pic doesn't show up, here's a text example:
Level1a
Level2a
Level2b
Level1b
Level1c
Here's what I don't want:
Level3a
Hello Mark,Thank you for choosing Infragistics components!I am glad that you have resolved this. If I may be of any further assistance please let me know.
I was able to accomplish this by using a split string function:
if (parentNode != null && (node.path.split("_").length) == 1 ) { var nodeText = "nodeText"; $("#tree").igTree("addNode", { Text: nodeText }, parentNode); $("#tree").igTree("expand", parentNode); }