I need to have my TreeGrid editable: Add and remove nodes.
Here is code to add a new node right after the selected one:
oNode = TreeGrid.getSelectedRecord();
TreeGrid.data.add(oNode, TreeGrif.data.getParentPath(oNode), TreeGrid.getRecordIndex(oNode));
Here is what is happening.
- The new node is added and it is a complete clone of selected node. +
- The new node is placed at the end of a list because TreeGrid.getRecordIndex(oNode) is not relative to a clonning node’s parent. I think. - How to get node’s position relative to its parent?
- Regardless where new node is the navigation thru the tree after new node is added highlights both original and new node together. - What am I doing wrong?
Please help.
Thanks