The makeDraggable() method activates an external item so it can be dragged to the Month component as a new event.
This method is static. Call it using the full DayPilot.Month.makeDraggable() prefix, not on a DayPilot.Month instance.
Declaration
DayPilot.Month.makeDraggable(options);Parameters
options.element(HTMLElement) - DOM node to activate for external drag and drop; ifoptions.removeis not specified, this node will be removed on dropoptions.data(object) - event data; available since 2026.1.6821options.remove(HTMLElement) - node to remove on drop; if not specified,options.elementis used; available since 2026.1.6821options.keepElement(boolean) - set totrueif the original element should not be removed from the DOM on dropoptions.externalCssClass(string) - CSS class applied to the moving shadow when it is outside of the Month component; optional; available since 2026.1.6821options.externalCursor(string) - CSS cursor used during external drag and drop; optional; available since 2026.1.6821options.externalHtml(string) - HTML added to the moving shadow when it is outside of the Month component; optional; available since 2026.1.6821options.onDragStart- event handler fired on drag start; receivesargs.optionsandargs.preventDefault(); optional; available since 2026.1.6821options.onDrop- event handler fired on drop; receivesargs.options; optional; available since 2026.1.6821
The options.data object can define the following properties:
id(string) - event IDtext(string) - event textduration(number | DayPilot.Duration) - event duration; a numeric value specifies the duration in seconds
Any additional properties of the options.data object will be copied to the Month event data object on drop.
Notes
Use externalCssClass, externalHtml, and externalCursor to customize the moving shadow while the dragged item is outside of the Month component.
Example
Call the static method using the full DayPilot.Month.makeDraggable() prefix:
<div id="item" data-id="1" data-duration="1440">Draggable item</div>
<script>
const e = document.getElementById("item");
const item = {
element: e,
data: {
id: e.dataset.id,
text: e.innerText,
duration: e.dataset.duration
}
};
DayPilot.Month.makeDraggable(item);
</script>See Also
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot