DayPilot.Scheduler.makeDraggableAsRow

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 object

  • options.element (DOM element) - the element to activate for drag and drop

  • options.remove (DOM element) - the element to remove on drop; if not specified, options.element is used

  • options.keepElement (boolean) - set to true if 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 ID

  • name (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()

DayPilot.Scheduler Class

Availability

Availability of this API item in DayPilot editions:

LitePro
DayPilot for JavaScript