1

I would like to detect event when item was dragged from tree#1 and dropped to tree#2. In this case i would like to call a specific http action to save it. I use the dropped event with actions inside one tree, but i can't manage it when i move item between trees. I tried to find differences in event 'dest' and 'source' objects, but did not found any solution.

1 Answer 1

1

I solved my problem. I added custom data-tree-type attribute to the tree

 <div ui-tree="treeOptions" id="tree-root" data-tree-type="mainTree" data-drag-delay="200">
        <ol ui-tree-nodes ng-model="data">
            <li ng-repeat="node in data" data-info="{{node.pageId}}" ui-tree-node ng-include="'nodes_renderer.html'"></li>
        </ol>
</div>

and then in angular-ui-tree.js in directive uiTree i added watch function

scope.$watch(attrs.treeType, function (val) {
     scope.treeType = attrs.treeType;
});

Now i can compare treeType attributes in droped event dest and source objects.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.