At this moment, onCardDelete doesn’t support asynchronous processing. With the current version, you would have to use the built-in confirm()
dialog which is synchronous:
onCardDelete: args => {
const result = confirm("Delete this Task?");
if (!result) {
args.preventDefault();
}
}
I’ve added the async handling to the wishlist, so in the future you will be able to use something like this:
onCardDelete: async args => {
args.async = true;
const modal = await DayPilot.Modal.confirm("Delete this Task?");
if (modal.canceled) {
args.preventDefault();
}
args.loaded();
}