The registerRowDropTarget() method registers an external element as a drop target for rows dragged out of the JavaScript Scheduler. It lets you drag rows from the Scheduler to that element.
This is a static method. Call it using the full prefix, not on a DayPilot.Scheduler instance.
Available since 2024.4.6270.
Declaration
DayPilot.Scheduler.registerRowDropTarget(options)Parameters
options.element(DOM element) - DOM node activated as the external drop targetoptions.onDragLeave- event handler fired when the dragged row leaves the target; optionaloptions.onDragOver- event handler fired continuously while the dragged row is over the target; optionaloptions.onDrop- event handler fired when the dragged row is dropped on the target; optional
The event handlers receive an args object with the following property:
args.row(DayPilot.Row) - source row being dragged
Example
DayPilot.Scheduler.registerRowDropTarget({
element: document.getElementById("queue"),
onDrop: (args) => {
const parent = document.getElementById("external");
const li = document.createElement("li");
li.setAttribute("data-id", args.row.id);
li.style.cursor = "move";
li.innerText = args.row.name;
parent.appendChild(li);
dp.rows.remove(args.row);
},
});See Also
External Drag and Drop of Rows [doc.daypilot.org]
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot