v7.3.0

DayCellRenderer
Mixin

Mixin that provides the ability to render calendar day cells, including event bars, overflow indicators, and day-number headers. It handles the layout of event bars within each cell, managing slot allocation for multi-day events that span across cells, and rendering the "+N more" overflow button when events exceed the cell's visible capacity.

This is used by the MonthView and also CalendarRow. It expects its host class to include the CalendarMixin mixin.

Views that use this mixin support customizing day cell content and overflow behavior:

const calendar = new Calendar({
    modes : {
        month : {
            // Customize the day cell content
            dayCellRenderer(cellData, domConfig) {
                if (cellData.day === 0 || cellData.day === 6) {
                    domConfig.className['is-weekend'] = true;
                }
            },
            // Configure overflow popup behavior
            overflowClickAction : 'popup',
            overflowPopup : {
                eventList : {
                    type : 'dayview'
                }
            }
        }
    }
});
No results

Configs

Configs are options you supply in a configuration object when creating an instance of this class
  • When we create the aria-label for a cell, we want to include the number of events in the cell. This is the localization key which will be used to format that string. By default, we announce "n events", but this can be overridden to announce "n all-day events" or whatever is appropriate for the view - see DayView#changeAllDayEvents.

  • How much vertical space in pixels to leave between event bars in a cell.

    Has a corresponding runtime eventSpacing property.

Properties

Properties are getters/setters or publicly accessible variables on this class
  • cellMap : Map
    READONLY

    Yields a Map which contains the cell data for each date in the current view. This is a Map where the keys are the date strings in the format YYYY-MM-DD and the values are DayCell objects which contain the data for that cell.

  • How much vertical space in pixels to leave between event bars in a cell.

    Has a corresponding eventSpacing config.

  • The OverflowPopup instance that this view may show when events for one day overflow the available space.

    Has a corresponding overflowPopup config.

  • isDayCellRenderer : Booleantrue
    READONLY
    ADVANCED
    Identifies an object as an instance of DayCellRenderer class, or subclass thereof.

Functions

Functions are methods available for calling on the class

    Events

    Events are triggered for certain actions in this class and can be listened for to react to those actions in your code

    Event handlers

    Event handlers are callbacks called as a result of certain actions in this class

    Source path

    Calendar/widget/mixin/DayCellRenderer.js

    Contents