The onBeforeTimeHeaderExport event handler fires during image and Excel export. It lets you provide plain text and export-specific styling for Gantt Chart time header cells because image export doesn't support HTML.
Available since version 2023.1.5529.
DayPilot.Gantt.onBeforeTimeHeaderExport(args)args.control (DayPilot.Gantt) - control instance
args.header.start (DayPilot.Date) - cell start
args.header.end (DayPilot.Date) - cell end
args.header.level (number) - header level (zero-based index)
args.header.text (string) - default text
args.header.html (string) - customized HTML
args.text (string) - exported text; by default it is set to customized HTML
args.backColor (string) - background color of the time header cell
args.fontColor (string) - exported font color
args.fontFamily (string) - exported font family
args.fontSize (string) - exported font size
args.fontStyle ("normal" | "italic" | "bold") - exported font style
Use this event to provide a plain-text alternative for headers customized with args.header.html. The exported output uses args.text, along with the specified background and font settings.
JavaScript
const gantt = new DayPilot.Gantt("dp", {
onBeforeTimeHeaderExport: (args) => {
args.text = args.header.text;
},
// ...
});
gantt.init();Angular
<daypilot-gantt [config]="config"></daypilot-gantt>config: DayPilot.GanttConfig = {
onBeforeTimeHeaderExport: (args) => {
args.text = args.header.text;
},
// ...
};React
<DayPilotGantt
onBeforeTimeHeaderExport={onBeforeTimeHeaderExport}
{/* ... */}
/>const onBeforeTimeHeaderExport = (args) => {
args.text = args.header.text;
};Vue
<DayPilotGantt
@beforeTimeHeaderExport="onBeforeTimeHeaderExport"
<!-- ... -->
/>const onBeforeTimeHeaderExport = (args) => {
args.text = args.header.text;
};Client-Side Image Export [doc.daypilot.org]