Draggable
Provides functionality to add dragging support to an HTML element.
Properties
axis DragDirection
Specifies the axis in which the drag path of the element will be prevented.
Default: X, Y
clone Boolean
Specifies the whether the dragging is performed on a clone of the element being dragged.
Default: true
cursorAt PositionModel
Defines the distance between the cursor and the draggable element.
Default: { "left": 0, "top": 0 }
distance Number
Specifies the distance the cursor must move away from the draggable element before the dragging starts.
Default: 0
dragArea String HTMLElement
Specifies the container the draggable element will be bound to.
Default: ""
handle String
Specifies the child element within the draggable element that will initiate the dragging.
Default: ""
helper Function
Specifies a callback function used to customize the cloned draggable element.
ignore String
Specifies whether the child element will prevent the dragging to start.
Default: ""
isScrollable Boolean
Specifies whether the defined dragArea is scrollable.
Default: false
scope String
Specifies the scope to group sets of draggable and droppable items together.
Default: ""
Methods
addEventListener
Attaches an event handler to a specified element. This method allows you to set up a function that will be called whenever the specified event is delivered to the target element.
Parameter | Type | Description |
---|---|---|
eventName | String | A string value that specifies the name of the event. |
handler | Function | Specifies the function to run when the event is triggered. |
Returns: Void
dataBind
Apply all pending property changes to the control.
Returns: Void
removeEventListener
Removes the attached event handler for the specified event listener.
Parameter | Type | Description |
---|---|---|
eventName | String | A string value that specifies the name of the event to be removed. |
handler | Function | Specifies the function to be removed. |
Returns: Void
Events
drag EmitType<DragEventArgs>
Specifies a callback function that is triggered while the element is being dragged.
dragStart EmitType<DragStartEventArgs>
Specifies a callback function that is triggered when the element starts to be dragged.
dragStop EmitType<DragStopEventArgs>
Specifies a callback function that is triggered when the element stops dragging.