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

eventDeleteHandling does not remove event

Asked by Jeff Kurzner
1 month ago.

I have successfully created function that removes events using the onEventDelete call. The record is properly removed from the database, but the schedule does nto get updated and show the item being removed. I tried using the same type of call that resize and mive use in dp.events.update(e), but it has no effect.

I also reviewed https://doc.daypilot.org/scheduler/event-deleting/ and tried to add the following above my dp.onEventDeleted function, but it generates an error which causes the schedule not to display at all.

dp.eventDeleteHandling = "Update";
dp.onEventDelete = function(args) {
    if (!confirm("Do you really want to delete this event?") {
      args.preventDefault();
    }
};

Can you point me in the right direction?

Answer posted by Jeff Kurzner
1 month ago.

Looks like I continue to find my own solutions. :) That's a good thing.

Here's the missing code that I found to assist me.

var e = dp.events.find(args.e.id());
dp.events.remove(e);

Comment posted by Jeff Kurzner
1 month ago.

Thanks

Comment posted by Dan Letecky [DayPilot]
1 month ago.

Thanks for posting the solution!

Anyway, if you use eventDeleteHandling = "Update" the Scheduler will remove the event and update the UI automatically (between onEventDelete and onEventDeleted, unless you call args.preventDefault() in onEventDelete).

New Reply
This reply is
Your name (optional):