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.
Declaration
DayPilot.Gantt.onBeforeTimeHeaderExport(args)Parameters
args.control(DayPilot.Gantt) - control instanceargs.header.start(DayPilot.Date) - cell startargs.header.end(DayPilot.Date) - cell endargs.header.level(number) - header level (zero-based index)args.header.text(string) - default textargs.header.html(string) - customized HTMLargs.text(string) - exported text; by default it is set to customized HTMLargs.backColor(string) - background color of the time header cellargs.fontColor(string) - exported font colorargs.fontFamily(string) - exported font familyargs.fontSize(string) - exported font sizeargs.fontStyle("normal"|"italic"|"bold") - exported font style
Notes
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.
Examples
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;
};See Also
Client-Side Image Export [doc.daypilot.org]
DayPilot.Gantt.onBeforeTimeHeaderRender
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot