Helper class for drag and drop support that is used for the source of drag and drop operations.
Inheritance Hierarchy
Members
Show:
Constructors
Initializes a new instance of the DragSource class, optionally setting the source property to the given element.
Initializes a new instance of the DragSource class, optionally setting the source property to the given element.
Parameters
- source?: any
- The source that is considered the origin of the drag. Will be set to source.
Properties
Gets or sets the DragDropEffects that will be used for the drag operation.
Gets or sets the DragDropEffects that will be used for the drag operation.
If this data is not a DragDropItem, the expected format of the automatic drag operation will be
code.final
Property Value
The drag data, the default value is
null.See Also
Methods
Cleans up by removing the association with the source element.
Cleans up by removing the association with the source element.
final
Raises the query-continue-drag event.
Raises the query-continue-drag event.
protected
Parameters
- evt: QueryContinueDragEventArgs
- The QueryContinueDragEventArgs instance containing the event data.
Initiates a new drag operation using the provided drag data and effects.
Initiates a new drag operation using the provided drag data and effects.
If
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-moveyfiles-cursor-dragdrop-linkyfiles-cursor-dragdrop-allyfiles-cursor-dragdrop-no-drop
Parameters
- 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?: any
- 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.
Return Value
Events
Occurs when the state of the DragDropKeyStates or the DropTarget has changed to query the source whether the drag operation should be continued.
Occurs when the state of the DragDropKeyStates or the DropTarget has changed to query the source whether the drag operation should be continued.
Properties of
QueryContinueDragEventArgs- action: DragActionwritable
- Gets or sets the action.
- dropTarget: DropTarget
- Gets the current dropTarget or null of there is no drop target.
- escapePressed: boolean
- Gets a value indicating whether the escape key had been pressed.
- handled: booleanwritable
- Gets or sets a value indicating whether this QueryContinueDragEventArgs is handled.
- keyStates: DragDropKeyStates
- Gets the current state of the keys.