The makeDraggable() method allows activating external items so they can be dragged to the JavaScript Scheduler component as events. It supports dragging using touch devices as well. See more at external drag and drop [].

This method is static. It has to be executed using the full prefix (not on a DayPilot.Scheduler class instance).




  • options.onDragStart - event handler that will be fired on drag start (args.options, args.preventDefault()); optional
  • options.onDrop - event handler that will be fired on drop (args.options); optional
  • - the source data object; since 2021.2.4941 (in prior versions, add id, text, and duration to options)
  • options.element (DOM element) - the element to be activated for drag and drop
  • options.remove (DOM element) - the element to be removed on drop; if not specified, options.element will be used
  • options.keepElement (boolean) - set to true if the original element should not be removed from DOM on drop; optional
  • options.externalCssClass (string) - CSS class that will be applied to the moving shadow (when it is outside of the Scheduler); optional
  • options.externalHtml (string) - HTML that will be added to the moving shadow (when it is outside of the Scheduler); optional

The source data object ( requires the following properties:

  • id (string | number) - event ID
  • text (string) - event text
  • duration (number | DayPilot.Duration) - event duration; you can also supply start and end properties instead of duration

All other properties of will be copied to the target object (and available in onEventMove as properties of


<div id="item" data-id="1" data-duration="60">Draggable item</div>

  var e = document.getElementById("item");

  var item = {
    element: e,
    data: {
      id: e.getAttribute("data-id"),
      text: e.innerText,
      duration: e.getAttribute("data-duration")