The onCardClick event handler fires before the default card click action.
Declaration
DayPilot.Kanban.onCardClick(args)Parameters
args.card(DayPilot.Card) - the clicked cardargs.preventDefault()- cancels the default click action
Notes
Use this event when you need to intercept a card click before the built-in action runs. To react after the default click handling has finished, use DayPilot.Kanban.onCardClicked.
Examples
JavaScript
const kanban = new DayPilot.Kanban("dp", {
onCardClick: (args) => {
args.preventDefault();
DayPilot.Modal.alert(`Clicked: ${args.card.data.name}`);
},
// ...
});
kanban.init();Angular
<daypilot-kanban [config]="config"></daypilot-kanban>config: DayPilot.KanbanConfig = {
onCardClick: (args) => {
args.preventDefault();
DayPilot.Modal.alert(`Clicked: ${args.card.data.name}`);
},
// ...
};React
<DayPilotKanban
onCardClick={onCardClick}
{/* ... */}
/>const onCardClick = (args) => {
args.preventDefault();
DayPilot.Modal.alert(`Clicked: ${args.card.data.name}`);
};Vue
<DayPilotKanban
@cardClick="onCardClick"
<!-- ... -->
/>const onCardClick = (args) => {
args.preventDefault();
DayPilot.Modal.alert(`Clicked: ${args.card.data.name}`);
};See Also
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot