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

Active drop-area in Calendar

Asked by Kim
6 years ago.

Hi, Is it possible to set an area/time-span as the active drop-area, or alternatively, disable surrounding areas? I would like to only allow dropping events to specific days and times.

Thanks

Answer posted by Dan Letecky [DayPilot]
6 years ago.

You can use the real-time event handlers to check custom conditions:

https://api.daypilot.org/daypilot-scheduler-oneventmoving/
https://api.daypilot.org/daypilot-scheduler-oneventresizing/
https://api.daypilot.org/daypilot-scheduler-ontimerangeselecting/

You can forbid the current target by setting args.allowed = false. This will forbid the drop action and it will also provide a visual hint to the user by changing the shadow color (by applying a custom css class).

See also a couple of examples here:
https://doc.daypilot.org/scheduler/event-moving-customization/

In addition to the changed color, you can also provide custom text using args.right.html.

Comment posted by Kim
6 years ago.

Thank you again, Dan.

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.