Occurs when drag-drop operation completes and item is dropped in TreeView space.
|e||Object||An event object which contains data about drag-drop operation|
The following objects are carried with this event:
- dragItem - the item(s) object that is(are) dragged
- dropPos - the position where dropped item will be placed. Here is a list of dropPos values:
- -1, item is placed to the end of tree hierarchy as a root item
- 0, item becomes a child of target item
- 1, item is placed above target item
- 2, item is placed below target item
- isDropAllowed - a Boolean value stating whether item is allowed to drop
- mousePos - the position of mouse cursor in page coordinates
- sourceTree - the name of the source TreeView from which item is dragged
- targetItem - the item object over which mouse cursor is currently positioned
- targetTree - the name of the target TreeView where item will be dropped
This event can be handled by creating a function in your application controller $scope and applying this function as value to an attribute in TreeView directive:
- drag-drop attribute, or
- events attribute
The events attribute has a higher priority than the drag-drop attribute. If both attributes are set, the value from events attribute is used.
For cancellation, simply return a false value in this event handler.
Supported in: v1.0.
Articles & Samples