angular-tree-component icon indicating copy to clipboard operation
angular-tree-component copied to clipboard

How to make child as root and and maintain hierarchy

Open VenkatEraga opened this issue 9 years ago • 1 comments

Hi,

Is it possible to make child as root (it should be at same position i.e current place of the node should not change) and sub child of the children should maintain hierarchy ?

Currently I am doing like this and it is working fine. Is there any other good approaches **

  • var position=this.getFlatNodeIndexPosition(node); // flat list position
  •         this.deleteNode(this.items,node.data);     
    
  •         node.data.parentId=0;
    
  •       this.items.splice(position,0,node.data);
    

**

And also while dragging, how to move children along with parent? currently, parent is moving and children are moving in background.

VenkatEraga avatar Apr 13 '17 15:04 VenkatEraga

Hi,

  1. Doesn't look like an issue for this library - I suggest you open a stackoverflow item. Please notice that you need to call update() on the treeModel if you mutate the tree structure.
  2. currently there's no plan to support custom drag image. You can implement it using a custom template.

adamkleingit avatar Apr 17 '17 17:04 adamkleingit