Target cell based on event type? Asked by Tom10 years ago. Is there a way to target the cell which an event is in? I need to add a custom background colour for the cell based on what type of event is on that day. This is in regard to using the calendar in month view. how-tojavascript
Answer posted by Dan Letecky [DayPilot]10 years ago. You can use onBeforeCellRender event like this: //... dp.onBeforeCellRender = function(args) { var events = dp.events.forRange(args.cell.start, args.cell.end); // check events array for event types.... // ... // has events? var hasEvents = !events.isEmpty(); if (hasEvents) { args.cell.cssClass = "has-events"; } };