MonthGrid
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-nameelement containing the group name. - A
.b-cal-event-bar-countelement containing the count of the number of events in the group. - An icon element with the class
b-fw-icon b-icon-group-expandorb-fw-icon b-icon-group-collapsedepending 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
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-labelof 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.
-
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-
Identifies an object as an instance of MonthGrid class, or subclass thereof.
-
The format used to create the month name in the
aria-labelof the group header of month event blocks.Has a corresponding groupHeaderAriaMonthFormat config.
-
The format used to display the month name in the month header of month event blocks.
Has a corresponding headerMonthFormat config.
-
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 minMonthHeight config.
-
Returns the twelve Stores which hold the events for each month displayed in this MonthGrid. Each Store is created with the modelClass of the eventStore of the Calendar. The Stores are created using the monthEventStore configuration.
-
The format used to display the date and time of events in EventTooltip tooltips.
Has a corresponding timeFormat config.
-
The space to leave between each month group. Defaults to no gap.
Has a corresponding viewGap config.
-
Identifies an object as an instance of MonthGrid class, or subclass thereof.