My favorites | Sign in
Project Home Downloads
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 320: Add Node flexibility
2 people starred this issue and may be notified of changes. Back to list
Status:  WontFix
Owner:  ----
Closed:  May 2014


 
Reported by sh...@thecranes.net.nz, May 30, 2012
What new or enhanced feature are you proposing?
I would request that node.addChild(nodeData[, beforeNode]) is enhanced to

node.addNode(nodeData, mode):
Adds a new node.

nodeData may be a node data object as defined in Node options, or an array thereof. Also objects and arrays of type DynaTreeNode are allowed.

Possible mode:
child: append the new node as last child of this node. This is the default. To be compatble with the D'n'd hitMode, we also accept 'over'.
before: add the new node as sibling before this node.
after: add the new node as sibling after this node.

What goal would this enhancement help you achieve?
This would provide flexibility when adding nodes to place them directly where you want them rather then having to move them around after creating them.

Provide a use case?
When I add a new node to a tree I expect it to add as a child, this is fine and works will with addChild(nodeData) but would also work well with the proposed addNode(nodeData) or addNode(nodeData,'child')

However, when I copy a node I expect it to appear as a sibling below the node I am copying. Currently the way to accomplish this is to either:
addChild followed my newNode.move (there is an issue related to doing this see  issue #319 )

or

addChild to the parent of the currently active node using the sibling after the active node (if there is one) as the beforeNode parameter.

The proposed method would simplify this to node.addNode(nodeData,'after');

In addition this would align the add node and move node modes which is always good for understanding.


Jun 3, 2012
Project Member #1 moo...@wwwendt.de
(No comment was entered for this change.)
Labels: Milestone-Release1.3
Jan 26, 2013
Project Member #2 moo...@wwwendt.de
(No comment was entered for this change.)
Labels: -Milestone-Release1.3 Milestone-Release2.0
May 1, 2014
Project Member #3 moo...@wwwendt.de
As of 2014 Dynatree is feature frozen.
Please have a look at Fancytree (sequel of DynaTree 1.x): chances are good that the problem was resolved / the requested featuer is already implemented.
Please open a new issue there otherwise:

https://github.com/mar10/fancytree
Status: WontFix

Powered by Google Project Hosting