search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Calendar: Allow external drag and drop but disable the moving feature for events on the Calendar?

Asked by Julien
11 days ago.

Using Daypilot Pro JavaScript, is it possible to allow an event to be dragged and dropped from an external source onto the calendar, but prevent the event from being moved once it is on the calendar?

In my application, the user will have to double-click an existing event to open a modal window where they can change the start and end time. I think I would prefer to disallow moving events by dragging them. Note that I’d like to disable to moving feature completely, not to be able to drag an event but with no allowed drop target.

Is that possible?

Answer posted by Dan Letecky [DayPilot]
11 days ago.

Yes, this is possible.

Keep the value of eventMoveHandling set to "Update".

Disable moving for all events by setting moveDisabled: true on each event. This can be done using onBeforeEventRender:

onBeforeEventRender: args => {
  args.data.moveDisabled = true;
}
Comment posted by Julien
11 days ago.

That works perfectly, thank you!

New Reply
This reply is
Attachments:
or drop files here
Your name (optional):