# Tree component...addTreeNodeAt & branch?

**URL:** https://forum.kirupa.com/t/tree-component-addtreenodeat-branch/189971
**Category:** Uncategorized
**Created:** [June 7, 2006, 5:02pm UTC](https://forum.kirupa.com/t/tree-component-addtreenodeat-branch/189971 "2006-06-07T17:02:43Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![flashpipe](https://avatars.discourse-cdn.com/v4/letter/f/839c29/32.png) [@flashpipe](https://forum.kirupa.com/u/flashpipe)
#### Post date: [June 7, 2006, 5:02pm UTC](https://forum.kirupa.com/t/tree-component-addtreenodeat-branch/189971/1 "2006-06-07T17:02:43Z")

</div>

I’ve got a tree component which works great, but I’m trying to add an item at a particular location (immediately after the item they select) into the tree.

The problem is that I’m trying to add an item within a branch. I’m using myTree.getDisplayIndex(myNode) to get the position within the tree, but it gives the location relative to the entire list, but I need to get the position relative to the parent (which is what myNode.parentNode.addTreeNodeAt is trying to write to)…

Anyone know how I can get the position of the item the user selects relative to it’s branch???

Thanks!!
