I am currently using Angular UI Tree connected trees. Tree1 has only one level of depth while Tree2 is unlimited in depth. I need to be able to drag any item from Tree2 INTO Tree1 items and catch that event.
Just to clarify: In effect Tree1 is the top level items of Tree2 and this allows me to easily move items between the overall data structure.
I could not find a way to do this under the current documentation, so I did the following: On Tree1 I disabled drop:
<div ui-tree="tree1Options" id="tree1-root" data-nodrop-enabled='true'>
and then on Tree2 I added the following call backs:
<div ui-tree="tree2Options" id="tree2-root">
$scope.tree2Options = {
dropped : function(event) {
console.log("dropped" + event);
},
dragStop : function(event) {
console.log("dragStop" + event);
},
beforeDrop : function(event) {
console.log("beforeDrop" + event);
},
}
When I drag from Tree2 onto Tree1 no placeholder is shown (which is fine), but I cannot get which item the drop was on from the destination. Seems like the dest is actually the source.
Any ideas? Also, if you know a better way to achieve DROP INTO?