DayPilot.Month.onBeforeCellRender

The onBeforeCellRender event is fired once for every cell during rendering. You can use it to customize the cell appearance.

Declaration

DayPilot.Month.onBeforeCellRender(args);

Parameters

  • args.cell.start (DayPilot.Date; read-only)
  • args.cell.end (DayPilot.Date; read-only)
  • args.cell.events() - returns an array of events (DayPilot.Event) that overlap this cell
  • args.cell.properties - customizable cell properties

Cell properties (args.cell.properties):

  • areas (array of area objects)
  • backColor (string)
  • backImage (string)
  • backRepeat (string)
  • business (boolean)
  • cssClass (string)
  • disabled (boolean) - available since 2022.2.5287)
  • headerHtml (string)
  • headerBackColor (string)
  • html (string)

The args.properties object is available since 2021.4.5146. In prior versions, these properties are available directly in the args.cell object (e.g. args.cell.cssClass).

Example

dp.onBeforeCellRender = function(args) {
  if (args.cell.start.getDayOfWeek() === 6) {
    args.cell.properties.backColor = "#eeeeee";
  }
};