You can use the onBeforeCellRender event to customize cell properties:
HTML
Header HTML
Background color
CSS class
Business status
JavaScript
See also
Example
onBeforeCellRender: (args) => {
args.cell.properties.html = "text";
if (args.cell.start.getDay() === 1) { // first day of month
args.cell.properties.backColor = "red";
}
args.cell.properties.headerHtml = args.cell.start.toString("d. MMMM"); // customize the day cell header
};ASP.NET WebForms
protected void DayPilotMonth1_BeforeCellRender(object sender, DayPilot.Web.Ui.Events.Month.BeforeCellRenderEventArgs e)
{
e.CssClass = Week.WeekNrISO8601(e.Start)%2 == 0 ? "even" : "odd";
}ASP.NET MVC
protected override void OnBeforeCellRender(BeforeCellRenderArgs e)
{
e.CssClass = Week.WeekNrISO8601(e.Start)%2 == 0 ? "even" : "odd";
}Availability
Availability of this feature in DayPilot editions:
| Lite | Pro | |
|---|---|---|
| DayPilot for JavaScript | ||
| DayPilot for ASP.NET WebForms | ||
| DayPilot for ASP.NET MVC | ||
| DayPilot for Java |
DayPilot