The onBeforeTaskRender event handler fires before a task is rendered. It lets you customize the task data used during rendering.
DayPilot.Gantt.onBeforeTaskRender(args)
args.type (string) - calculated task type: "Task" | "Group" | "Milestone"args.data (DayPilot.Task.data) - task data (a shallow copy of the original data object)The args.task.children property is not available in this event.
const gantt = new DayPilot.Gantt("dp", {
onBeforeTaskRender: (args) => {
args.data.cssClass = "important-task";
args.data.box.html = "Task description";
},
// ...
});
gantt.init();
<daypilot-gantt [config]="config"></daypilot-gantt>
config: DayPilot.GanttConfig = {
onBeforeTaskRender: (args) => {
args.data.cssClass = "important-task";
args.data.box.html = "Task description";
},
// ...
};
<DayPilotGantt
onBeforeTaskRender={onBeforeTaskRender}
{/* ... */}
/>
const onBeforeTaskRender = (args) => {
args.data.cssClass = "important-task";
args.data.box.html = "Task description";
};
<DayPilotGantt @beforeTaskRender="onBeforeTaskRender" <!-- ... --> />
const onBeforeTaskRender = (args) => {
args.data.cssClass = "important-task";
args.data.box.html = "Task description";
};