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

Scheduler - How to cancel event moving after server call

Asked by Anonymous
6 months ago.

How can I cancel the event moving after the a server call (REST API call)? Calling args.preventDefault(); doesn’t work. After calling args.preventDefault(); I can’t move any event anymore

eventMoveHandling is set to 'Update'.

onEventMove: (args) => {
    args.async = true;
    this.moveItem(args)
      .subscribe(result => {
        if (result) {
          args.loaded();
        }
        else {
          args.preventDefault();
        }
      });
}
Answer posted by Dan Letecky [DayPilot]
6 months ago.

You should always call args.loaded() after switching to async processing (args.async = true).

Like this:

onEventMove: (args) => {
    args.async = true;
    this.moveItem(args)
      .subscribe(result => {
        if (!result) {
          args.preventDefault();
        }
        args.loaded();
      });
}
Comment posted by Anonymous
6 months ago.

Thank you very much for the instant reply

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