NodeDrag: function(sender, args);
sender. Event source.
args. Event information:
After. String. Key of the node, after which the dragged node is inserted.
Before. String. Key of the node, before which the dragged node is inserted.
CanInsertAfter. Boolean. Indicates whether it is available to insert after.
CanInsertBefore. Boolean. Indicates whether it is available to insert before.
CanTakeChildren. Boolean. The node, to which insert is executed, may have children.
Event. Object. Information about mouse drag.
Nodes. Array of String. Array of keys of dragged nodes.
StartTree. PP.Ui.SimpleTreeList. The tree, from which node is dragged.
TargetNode. String. Key of the node, to which mouse cursor is pointed.
TargetNodeParent. String. Key of the node ancestor, to which mouse cursor is pointed.
The NodeDrag event occurs on moving the dragged node along tree elements.
Executing the example requires the SimpleTreeList component with the Tree identifier (see Example of Creating the SimpleTreeList Component).
// Enable drag-and-drop mode Tree.setEnableDragAndDrop(true); // Set events Tree.NodeDragStart.add( function(sender, args) { console.log("NodeDragStart event:"); console.log(args); }); Tree.NodeDrag.add( function(sender, args) { console.log("NodeDrag event:"); console.log(args); }); Tree.NodeDragEnd.add( function(sender, args) { console.log("NodeDragEnd event:"); console.log(args); }); Tree.NodeDragFinished.add( function(sender, args) { console.log("NodeDragFinished event:"); console.log(args); }); // Initialize events by dragging node to random position
After executing the example drag events are added.
See also: