The onBeforeCellExport event is fired during image export (JPEG, PNG, SVG) and direct printing. Allows you to provide alternative text for the Scheduler grid cell (image export doesn't support HTML in grid cells).
DayPilot.Scheduler.onBeforeCellExport(args);
args.areas
- an array of active areas (areas defined using onBeforeCellRender are copied); since 2021.4.5168
args.cell
- exported grid cell object (read-only)
args.fontColor
(string) - font color; since 2021.4.5168
args.fontFamily
(string) - font family; since 2021.4.5168
args.fontSize
(string) - font size; since 2021.4.5168
args.fontStyle
(string) - font style; since 2021.4.5168
args.format
(string) - the target format set using exportAs(), readonly - since version 2025.1.6393
args.text
(string) - exported text
args.horizontalAlignment
(string) - "left" | "center" | "right"
args.backColor
(string) - background color
The args
object is the same instance that is used in onBeforeCellRender (which is called right before onBeforeCellExport).
Basic HTML to text conversion - replaces line breaks.
Scheduler config:
onBeforeEventExport: (args) => {
args.text = args.e.client.html().replace("<br>", "\n");
};