The makeDraggableAsRow() method activates an external element so it can be dragged to the JavaScript Scheduler component as a row.
This method is static. Call it using the full prefix, not on a DayPilot.Scheduler class instance.
Available since 2024.4.6270.
Declaration
DayPilot.Scheduler.makeDraggableAsRow(options)Parameters
options.data- the source data objectoptions.element(DOM element) - the element to activate for drag and dropoptions.remove(DOM element) - the element to remove on drop; if not specified,options.elementis usedoptions.keepElement(boolean) - set totrueif the original element should not be removed from the DOM on drop; optional
The source data object (options.data) requires the following properties:
id(string | number) - resource IDname(string) - resource name
Notes
See External Drag and Drop of Rows for the full workflow.
Example
Assuming the page contains <div id="item" data-id="1">Draggable item</div>:
const element = document.getElementById("item");
DayPilot.Scheduler.makeDraggableAsRow({
element,
data: {
id: element.getAttribute("data-id"),
name: element.innerText
}
});See Also
External Drag and Drop of Rows [doc.daypilot.org]
DayPilot.Scheduler.makeDraggable()
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot