Helper class for drag and drop support that is used for the source of drag and drop operations.
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.view.DragSource
See Also
Constructors
Initializes a new instance of the DragSource class, optionally setting the source property to the given element.
Properties
Gets or sets a value indicating whether default drag gestures should be automatically recognized on the source.
Gets or sets the DragDropEffects that will be used for the automatic drag operation.
Gets or sets the data that will be used for the automatic drag operation.
Remarks
code
.See Also
Gets or sets the source element from which drags can originate.
Remarks
Methods
Cleans up by removing the association with the source element.
Raises the QueryContinueDrag event.
Remarks
Parameters
A map of options to pass to the method.
- evt - QueryContinueDragEventArgs
- The QueryContinueDragEventArgs instance containing the event data.
startDrag
(dragData: DragDropItem, dragDropEffects?: DragDropEffects, useCssCursors?: boolean, dragPreview?: HTMLElement | SVGElement) : Promise<boolean>Initiates a new drag operation using the provided drag data and effects.
Remarks
useCssCursors
is enabled, the following CSS classes are assigned to elements hovered during a drag operation, depending on the allowed drag-drop operations for these elements:yfiles-cursor-dragdrop-move
yfiles-cursor-dragdrop-link
yfiles-cursor-dragdrop-all
yfiles-cursor-dragdrop-no-drop
Parameters
A map of options to pass to the method.
- dragData - DragDropItem
- The data to use for the drag.
- dragDropEffects - DragDropEffects
- The allowed effects.
- useCssCursors - boolean
- Whether to adjust the classes of elements being hovered over during the drag. The default is
true
. - dragPreview - HTMLElement | SVGElement
- Optional element that should be shown during dragging, e.g. outside of the GraphComponent. Note that this feature requires support for CSS pointer-events and should not be used in browsers that do not support it.
Returns
Events
Occurs when the state of the DragDropKeyStates or the DropTarget has changed to query the source whether the drag operation should be continued.
Remarks
Event Registration
addQueryContinueDragListener(function(this, QueryContinueDragEventArgs):void)
Event Deregistration
removeQueryContinueDragListener(function(this, QueryContinueDragEventArgs):void)
Signature Details
function(sender: this, evt: QueryContinueDragEventArgs)
Parameters
- sender - this
- The source of the event.
- evt - QueryContinueDragEventArgs
- An object that contains the event data.