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

cancel an onEventMoved or onEventResized

Asked by Lorne
7 years ago.

If my client side javascript code how do would stop the user moving and resizing an event from within the event handler?

Answer posted by Lorne
7 years ago.

Found the answer: hope this helps other people save some time

//This gets called when the user drops the event
dp.onEventMove = function (args) {

//args.e is the event object that is being moved
//args.newStart
//args.newEnd
//args.newResource

//This cancels the event move do this conditionally based on some business rules
args.preventDefault.value = true;

};

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

Thanks for posting the answer.

The recommended way is to use args.preventDefault().

See also:
http://api.daypilot.org/daypilot-calendar-oneventmove/

The args.preventDefault.value is an internal API and it may change it the future.

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