v7.3.0

MonthGrid
Widget

A Panel which displays a grid of twelve month-event blocks. Each block representing a month of the year, contains a list of events for that month ordered according to the eventSorter configuration.

The events for a month are extracted from the Calendar's eventStore and loaded into twelve monthEventStores which may be configured using the monthEventStore configuration.

The months are rendered in a six by two grid, with each month block containing a header with the month name. The month blocks have a minimum width of 190 pixels. If available space makes a block narrower than this, the arrangement will fall back to the next logical arrangement, which is a four by three grid etc.

When the column count has changed, the columnCountChange event is fired.

Each month block will scroll vertically if the events in that month overflow the height of the block. Scroll bars may be hidden usinvg the hideEventScroll configuration.

The minMonthHeight configuration may be used to set a minimum height for every month block. If the month blocks overflow the height of the view's available space, the view will scroll.

Grouping

If grouping is configured on the monthEventStore, the group header records will be rendered as a single event bar with the group name and a count of the number of events in the group.

These records will be passed through the groupHeaderRenderer function to produce the group header content. By default, the group header bar will have the class b-cal-event-bar-group and the class b-cal-event-bar-collapsed if the group is collapsed. It will contain three elements:

  • A .b-cal-event-bar-name element containing the group name.
  • A .b-cal-event-bar-count element containing the count of the number of events in the group.
  • An icon element with the class b-fw-icon b-icon-group-expand or b-fw-icon b-icon-group-collapse depending on whether the group is collapsed or expanded.

The group header bar will have the aria-label attribute set to the group name and the count of the number of events in the group. The group header bar will also have the aria-expanded attribute set to true if the group is expanded, or false if the group is collapsed.

If grouping is done by resource, the group header bar will have the resource-id attribute set to the resource's id which will enable the resourceClick, resourceContextMenu and resourceDoubleClick etc events to be fired when the group header is intercted with.

If grouping is done by some other linked record, the group header bar will have the id of that record set in the data-attribute data-[modelType]-id where modelType is the class name of the linked record which can be accessed in a groupRecordClick handler.

Clicking on a group header will toggle the collapsed state of the group, and will fire the groupRecordClick event.

Drag/drop and autoCreate

Due to an event bar's position having no relationship to its start time, this view does not participate in the CalendarDrag feature, and does not support drag and drop of events.

For the same reason, this view does not support the autoCreate property that other Calendar views support.

Useful configs

Config Description
monthEventStore Config for the per-month event stores
minMonthHeight Minimum height for each month block
hideEventScroll Hide scrollbars on month event blocks
eventRenderer Custom renderer for event bars

See also

  • Calendar — The main Calendar that hosts this view
  • YearView — Parent class providing year-level display
  • MonthView — Alternative month view showing a single month grid
No results

Configs

Configs are options you supply in a configuration object when creating an instance of this class
  • The format used to create the month name in the aria-label of the group header of month event blocks.

    Has a corresponding runtime groupHeaderAriaMonthFormat property.

  • The format used to display the month name in the month header of month event blocks.

    Has a corresponding runtime headerMonthFormat property.

  • The minimum height of each month block. If the month blocks overflow the height of the view's available space, the view will scroll.

    Has a corresponding runtime minMonthHeight property.

  • timeFormat : String'MMM DD YYYY HH:mm'

    The format used to display the date and time of events in EventTooltip tooltips.

    Has a corresponding runtime timeFormat property.

  • The space to leave between each month group. Defaults to no gap.

    Has a corresponding runtime viewGap property.

Properties

Properties are getters/setters or publicly accessible variables on this class

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

    CSS variables

    CSS variables that can be set to adjust appearance
    Name Description
    --b-month-grid-event-container-background-color Event container background color (within each month)
    --b-month-grid-event-group-active-expand-icon-color Event group active expand icon color. This is used when grouping events in the month grid.
    --b-month-grid-event-group-background-color Event group background color. This is used when grouping events in the month grid.
    --b-month-grid-event-group-border-color Event group border color. This is used when grouping events in the month grid.
    --b-month-grid-event-group-border-radius Event group border radius. This is used when grouping events in the month grid.
    --b-month-grid-event-group-expand-icon-color Event group expand icon color. This is used when grouping events in the month grid. The icon is used to expand/collapse the event group.
    --b-month-grid-month-background-color Month background color
    --b-month-grid-month-header-background Month header background
    --b-month-grid-month-header-color Month header text color
    --b-month-grid-month-header-hover-background Month header hover background
    type: monthgrid

    Source path

    Calendar/widget/MonthGrid.js

    Demo

    examples/monthgrid

    Contents