The registerDropTarget() method registers an external element, typically a list of unscheduled events, as a drop target for Scheduler events dragged out of a DayPilot.Scheduler instance with dragOutAllowed set to true.
This is a static method. Call it using the full prefix, not on a DayPilot.Scheduler instance.
Available since 2021.2.4931.
DayPilot.Scheduler.registerDropTarget(options)options.element (DOM element) - DOM node activated as the external drop target
options.onDragEnter - event handler fired when the dragged event enters the target; available since 2025.4.6742
options.onDragLeave - event handler fired when the dragged event leaves the target; optional
options.onDragOver - event handler fired continuously while the dragged event is over the target; optional
options.onDrop - event handler fired when the dragged event is dropped on the target; optional
The event handlers receive an args object with the following property:
args.e (DayPilot.Event) - source event being dragged
DayPilot.Scheduler.registerDropTarget({
element: document.getElementById("queue"),
onDrop: (args) => {
const parent = document.getElementById("external");
const li = document.createElement("li");
li.setAttribute("data-duration", args.e.duration().totalHours());
li.setAttribute("data-id", args.e.id());
li.style.cursor = "move";
li.innerText = args.e.text();
parent.appendChild(li);
makeDraggable();
dp.events.remove(args.e);
},
});DayPilot.Scheduler.dragOutAllowed