v7.3.0

CalendarMixin
Mixin

Mixin that provides the core shared functionality for all Calendar view widgets, including event rendering, store management, feature support, keyboard navigation, and date-based scrolling. Any widget that participates as a Calendar mode (such as DayView, WeekView, MonthView, YearView, AgendaView, and EventList) mixes in this class to gain a consistent API for event display, hit-testing, resource avatar rendering, and interaction with the parent Calendar.

This mixin also brings in the Featureable mixin.

All Calendar views share these common APIs from this mixin. For example:

const calendar = new Calendar({
    modes : {
        week : {
            // Configs from CalendarMixin available on all view types
            eventHeight : 22,
            autoCreate  : {
                duration : '1 hour',
                startHour : 9
            },
            eventRenderer({ eventRecord, renderData }) {
                // Custom event rendering logic
                renderData.cls['high-priority'] = eventRecord.priority === 1;
                return eventRecord.name;
            }
        }
    }
});

// Navigate the active view calendar.activeView.next(); calendar.activeView.previous();

// Scroll to a specific date calendar.activeView.scrollTo(new Date(2024, 0, 15));
No results

Configs

Configs are options you supply in a configuration object when creating an instance of this class
  • Configure this as false to disable drag-creating events in this view.

    Has a corresponding runtime allowDragCreate property.

  • Configure this as false to disable drag-moving events in this view.

    Has a corresponding runtime allowDragMove property.

  • Configure this as false to disable drag-resizing events in this view.

    Has a corresponding runtime allowDragResize property.

  • allowOverlap : Booleantrue
    private

    Set to false if you don't want to allow events overlapping times for any one resource (defaults to true).

  • dayCellCls : String
    private

    The class name to add to calendar cells.

    Has a corresponding runtime dayCellCls property.

  • Configure as true to hide nonWorkingDays

    Has a corresponding runtime hideNonWorkingDays property.

  • The maximum date to which the endDate of this view may be navigated.

    Has a corresponding runtime maxDate property.

  • The minimum date to which the startDate of this view may be navigated.

    Has a corresponding runtime minDate property.

  • The class name to add to calendar cells which are non working days.

  • Non-working days as an object where keys are day indices, 0-6 (Sunday-Saturday), and the value is true. Defaults to nonWorkingDays.

    Has a corresponding runtime nonWorkingDays property.

  • A button configuration object to use for the automatically created mode selector button for this mode.

  • A menu item configuration object to use for the automatically created mode selector menu item for this mode.

  • The class name to add to events which have duration less than or equal to shortEventDuration.

  • A title text used by the Calendar's mode selector button. If not specified, the mode name is used.

  • The week start day, 0 meaning Sunday, 6 meaning Saturday. Defaults to weekStartDay.

  • weekendCls : String
    private

    The class name to add to calendar cells which are weekend days.

Properties

Properties are getters/setters or publicly accessible variables on this class
  • activeSubView : CalendarView
    internal
    READONLY

    This property yields this widget. This is to enable Calendar Features to be able to attach to standalone Calendar widgets as their owning client, and to access a currently active view in a standard way.

  • activeView : CalendarView
    internal
    READONLY

    This property yields this widget. This is to enable Calendar Features to be able to attach to standalone Calendar widgets as their owning client, and to access a currently active view in a standard way.

  • Configure this as false to disable drag-creating events in this view.

    Has a corresponding allowDragCreate config.

  • Configure this as false to disable drag-moving events in this view.

    Has a corresponding allowDragMove config.

  • Configure this as false to disable drag-resizing events in this view.

    Has a corresponding allowDragResize config.

  • The class name to add to calendar cells.

    Has a corresponding dayCellCls config.

  • duration : Number
    READONLY

    The duration in total days that this view covers.

  • eventHeightInPixels : Number
    private
    READONLY

    Returns the pixel value of the eventHeight in case it was configured as a CSS measurement in other units.

  • The first visible event-bearing element in this view. So if the first day defined in the range is a Sunday, and hideNonWorkingDays is set, then the first visible cell will be for the Monday.

  • The date of the first visible event-bearing element in this view. So if the first day defined in the range is a Sunday, and hideNonWorkingDays is set, then the first visible date will be the date of the Monday.

  • hiddenNonWorkingDays : Object<Number, Boolean>
    READONLY

    This property yields the nonWorkingDays which are hidden in this view if and only if this view is configured to hideNonWorkingDays. Otherwise it returns an empty object.

  • Configure as true to hide nonWorkingDays

    Has a corresponding hideNonWorkingDays config.

  • The last visible event-bearing element in this view. So if the last day defined in the range is a Sunday, and hideNonWorkingDays is set, then the last visible cell will be for the Friday.

  • lastVisibleDate : Date
    READONLY

    The date of the last visible event-bearing element in this view. So if the last day defined in the range is a Sunday, and hideNonWorkingDays is set, then the last visible date will be the date of the Friday.

  • The maximum date to which the endDate of this view may be navigated.

    Has a corresponding maxDate config.

  • The minimum date to which the startDate of this view may be navigated.

    Has a corresponding minDate config.

  • modeName : String
    READONLY

    Calendar mode that this view represents (eg. "day", "month" etc). Only accessible when used within a Calendar.

  • Non-working days as an object where keys are day indices, 0-6 (Sunday-Saturday), and the value is true. Defaults to nonWorkingDays.

    Has a corresponding nonWorkingDays config.

  • A DateHelper format string/function to use to create date output for abbreviated view descriptions.

    Has a corresponding shortDateFormat config.

  • A DateHelper format string/function to use to create date and time output for abbreviated view descriptions.

    Has a corresponding shortDateTimeFormat config.

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

Functions

Functions are methods available for calling on the class
    • next( )

      Moves this view forwards in time by its configured (or intrinsic if it's a WeekView or a YearView) duration.

    • Moves this view backwards in time by its configured (or intrinsic if it's a WeekView or a YearView) duration.

    • undoRedoDataChange( )
      internal

      The key handler for CTRL+Z undo key combination. If enableUndoRedoKeys is enabled, the last data change will be undone.

    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/CalendarMixin.js

    Contents