sdserlin Posted February 14, 2014 Report Share Posted February 14, 2014 The help page on the Edit Tree Items: Move Item Method states for "New Position": "Sets where to place the item in relation to the item whose tag you wire to New Parent. Wire a value of 0 (default) to place the item above the first child item, wire a value of 1 to place the item above the second child item, and so on. Wire a value of –1 to place the item under the last child item. If the value you wire to this input is greater than the number of child items under the parent item, the method places the item under the last child item." If I do not know in advance what the new position will be until the user chooses an item on the tree, what algorithm can take the selection row number and then adjust this "new position" value to move up by one row or down by one row? I can't just take the ActiveItemRowNumber and subtract one or add one to get the previous item-row-number or the next item-row-number and then take that value into the "Edit Tree Items.Move item" invoke node because the .Move item node does not work that way. Why it doesn't is beyond me. Nonetheless, I need a workaround to this issue. Any suggestions? Quote Link to comment
hooovahh Posted February 14, 2014 Report Share Posted February 14, 2014 Please do not double post. If you are unhappy with your first post you are welcome to edit it, or us the Report to Moderator button to get posts edited or deleted. On topic could you post some code of what you have. It's still a little difficult knowing what you want. You are saying what method can you use to move an item that the user selects up or down? Okay so I think I found what you were talking about, and I think I have a solution. I don't know if there is a better way of using it, but what it will do is find the parent of the current tag, then find all children under that parent. Then find within that list of children, where does our current tag exist. Then move that position. Alternatively you could allow the user to click and drag to move items around, but I admit that getting this to work the way you want can be a pain. Tree Move Item Up.vi 1 Quote Link to comment
sdserlin Posted February 17, 2014 Author Report Share Posted February 17, 2014 Thank you for your help. That is exactly what I was looking for. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.