DayPilot.Kanban.onBeforeCardRender

The onBeforeCardRender event lets you customize the task cards in the JavaScript Kanban component.

This event is called for every card when it is loaded. You can use it to dynamically set event text, HTML, active areas, bar color and other properties.

Declaration

DayPilot.Kanban.onBeforeCardRender(args)

Parameters

  • args.data (object) - a shallow copy of the source data object

Example

Kanban config:

{
  onBeforeCardRender: args => {
      args.data.areas = [
          {
              right: 5,
              top: 5,
              width: 20,
              height: 20,
              symbol: "../icons/daypilot.svg#edit",
              action: "None",
              onClick: (args) => {
                  const card = args.source;
                  app.editCard(card);
              }
          }
      ];
  },
  // ...
}