DayPilot.Scheduler.onBeforeCellRender

Fired before the grid cell is rendered. You can use this event to customize the cell appearance.

Declaration

DayPilot.Scheduler.onBeforeCellRender(args)

Parameters

  • args.cell.areas (array of area objects)
  • args.cell.resource (string; read-only)
  • args.cell.start (DayPilot.Date object; read-only)
  • args.cell.end (DayPilot.Date object; read-only)
  • args.cell.cssClass (string, custom cell CSS class)
  • args.cell.html (string, custom cell HTML)
  • args.cell.backImage (string, background image URL)
  • args.cell.backRepeat (string, background-repeat style)
  • args.cell.backColor (string, custom cell background color, e.g. "#ccc" or "red")
  • args.cell.business (boolean, busines/non-business status)
  • args.cell.x (number; horizontal position/index in the grid )
  • args.cell.y (number; vertical position/index in the grid)
  • args.cell.events() - returns an array of events that overlap this cell
  • args.cell.utilization(fieldName) - calculates utilization using the specified field of the event data object

Example

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

DayPilot for JavaScript, ASP.NET WebForms, ASP.NET MVC, Java