DayPilot.Kanban.onCardDelete

The onCardDelete event is fired before the default event delete action.

You can cancel the default action (which is to remove the card from the control when cardDeleteHandling is set to "Update") by calling args.preventDefault().

Declaration

DayPilot.Kanban.onCardDelete(args);

Parameters

  • args.card (DayPilot.Card object)

  • args.preventDefault()

Example

<div id="kanban"></div>

<script>

    const kanban = new DayPilot.Kanban("kanban", {
      cardDeleteHandling: "Update",
      onCardDelete: (args) => {
        if (!confirm("Do you really want to delete this card?")) {
          args.preventDefault();
        }
      },
      // ...
    });

    kanban.init();

</script>