EventList
A Grid view of the EventStore.
This shows a configured range of events from the event store.
When used as a mode of a Calendar, the configured range is snapped to encapsulate the Calendar's current date.
If configured with an explicit startDate and endDate, the
range is not used. When setting the date, the duration
of the configured range is preserved, but the range is shifted backwards or forwards in time
just enough to bring the passed Date into view.
The EventList's header context menu is extended to allow the user to change the range type. This
may be disabled by configuring the listRangeMenu as null.
For further information about features available to be configured directly into EventList
calendar views, see the Grid documentation and the associated examples.
//<code-header>
fiddle.title = 'List view';
//</code-header>
new EventList({
appendTo : targetElement,
height : 700,
date : '2021-09-01',
events : [
{ startDate : '2021-09-01T07:00', duration : 2, durationUnit : 'h', name : 'Water flowers', eventColor : 'red' },
{ startDate : '2021-09-31T09:00', duration : 3, durationUnit : 'h', name : 'Take daughter to volley ball', eventColor : 'pink' },
{ startDate : '2021-09-04T07:00', duration : 5, durationUnit : 'h', name : 'Walk the dog', eventColor : 'yellow' },
{ startDate : '2021-09-04T09:00', duration : 2, durationUnit : 'h', name : 'Buy masks', eventColor : 'orange' },
{ startDate : '2021-09-05T07:00', duration : 1, durationUnit : 'h', name : 'Zoom meeting', eventColor : 'deep-orange' },
{ startDate : '2021-09-05T09:00', duration : 1, durationUnit : 'h', name : 'Get a haircut', eventColor : 'gray' }
]
});Configs
202
Configs
202Common
Other
Column definitions to add to the default columns, or column definitions which override the provided, default columns.
By default, the EventList shows three columns:
columns : [{
text : 'Name',
field : 'name'
}, {
text : 'Start',
field : 'startDate'
}, {
text : 'End',
field : 'endDate'
}]
Your columns config is appended to the default columns unless you provide
columns for the name, startDate and endDate fields, in which case your
column definitions are merged into the default column definitions.
In this way you can provide a renderer for the default columns, or otherwise
configure them in a customizable way.
You can also supply columns keyed by field, to reconfigure / remove / add similar to how you would manage items in containers and menus:
columns : {
// Remove the name column
name : null,
// Change the format of the startDate column
startDate : {
format : 'YYYY'
},
// Add a description column
description : {
renderer : ({ record }) => record.description.substring(0, 10)
}
}
A DateHelper format string/function used to format the time displayed next to event bars in the custom columns which EventList based views use - EventList and AgendaView.
| Parameter | Type | Description |
|---|---|---|
date | Date | The date to format. |
The formatted date.
A function, or name of a function in the ownership hierarchy which is used to create the time output next to event bars in an agenda cell.
The result of this function is used as the content of an element which has
the CSS class 'b-cal-event-list-event-time'.
modes :
agenda : {
// Add extra info below the time.
// We set .b-cal-event-list-event-time to flex-direction : column
eventTimeRenderer({ eventRecord, date }) {
return [
this.defaultEventTimeRenderer({ eventRecord, date }),
{
className : 'event-location',
text : eventRecord.location
}
];
}
}
}
| Parameter | Type | Description |
|---|---|---|
eventRecord | EventModel | The event record for which to create a time string. |
date | Date | The date of the cell in which the event is being rendered. |
A RangeMenu configuration block which configures the range choosing menu provided which by default selects one of the following:
- day
- week
- month
- year
- decade
This may be used to either reconfigure that menu, or, by configuring it as null, could remove
the menu entirely if the date range of this view is controlled by other means.
The individual range menu items are under the items property and have the following
property names:
listRangeDayItemlistRangeWeekItemlistRangeMonthItemlistRangeYearItemlistRangeDecadeItem
These may be reconfigured:
calendar = new Calendar({
...
modes : {
agenda : {
listRangeMenu : {
items : {
// We don't want the decade range option
listRangeDecadeItem : null
}
}
}
}
});
Content
CSS
DOM
Float & align
Layout
Masking
misc
Misc
State
Tree
Properties
181
Properties
181Common
Class hierarchy
Other
A function, or name of a function in the ownership hierarchy which is used to create the time output next to event bars in an agenda cell.
The result of this function is used as the content of an element which has
the CSS class 'b-cal-event-list-event-time'.
modes :
agenda : {
// Add extra info below the time.
// We set .b-cal-event-list-event-time to flex-direction : column
eventTimeRenderer({ eventRecord, date }) {
return [
this.defaultEventTimeRenderer({ eventRecord, date }),
{
className : 'event-location',
text : eventRecord.location
}
];
}
}
}
| Parameter | Type | Description |
|---|---|---|
eventRecord | EventModel | The event record for which to create a time string. |
date | Date | The date of the cell in which the event is being rendered. |
This property yields a RangeMenu configuration block which encapsulates the range choices which this widget may be set to encapsulate:
- day
- week
- month
- year
- decade
By default a list view adds these choices to the header context menu.
An agenda view creates a floating settings button which offers this menu.
The property may be used to create a custom UI for changing the range.
The value yielded by the default get listRangeMenu() implementation looks like this:
{
items : {
listRangeDayItem : {config for DAY range menu item },
listRangWeekItem : {config for WEEK range menu item },
listRangMonthItem : {config for MONTH range menu item },
listRangeYearItem : {config for YEAR range menu item },
listRangeDecadeItem : {config for DECADE range menu item }
}
}
A subclass can override get listRangeMenu() and mutate the object returned by the super call.
For example, it could delete properties of the items block to limit which ranges may be selected.
Returns the resource associated with this event list when used inside a ResourceView
CSS
DOM
Layout
Misc
Scrolling
Selection
State
Tree
Widget hierarchy
Functions
147
Functions
147Other
This method produces the date details block in AgendaView cells as a DomConfig object.
The content is encapsulated in an element with CSS class b-cal-agenda-date.
| Parameter | Type | Description |
|---|---|---|
date | Date |
The date details block in the following format:
{
className : {
'b-day-name' : 1,
'b-cal-agenda-date' : 1,
'b-today' : true|false
},
'aria-hidden' : true,
children : [{
className : {
'b-cal-agenda-date-date-number' : 1
},
text : 15 // The date
}, {
className : {
'b-cal-agenda-date-date-text' : 1
},
children : [{
text : 'Monday' // The day name
}, {
text : 'Jun 2020' // The month and year
}]
}]
}
Creates the Month utility object. We use it to track what week we are looking at.
Produces the time details next to the event bar in EventList and AgendaView.
This may be called from a custom eventTimeRenderer function to produce the default time details.
| Parameter | Type | Description |
|---|---|---|
eventRecord | EventModel | |
forDate | Date | The date cell into which the event is being rendered. |
The time details.
This method produces the event time details next to the event bar in EventList and AgendaView as a DomConfig object.
The content is encapsulated in an element with CSS class b-cal-event-list-event-time.
For multi day events, the ending date is shown. For intra-day events, the start and end
times are shown.
| Parameter | Type | Description |
|---|---|---|
eventRecord | EventModel | |
forDate | Date | The date cell into which the event is being rendered. |
This is added as a listener by the CalendarStores mixin.
Our store is chained off of the EventStore; refill it if the EventStore changes. The store will fire events which cause UI update. We must fire a refresh event so that the encapsulating Calendar view knows about this.
When the date we have been told to look at changes, recalculate the date range. If the date range changes, this will cause a refill of our grid store from the master event store.
Scrolls vertically to bring an event or a time into view.
| Parameter | Type | Description |
|---|---|---|
target | EventModel | Date | String | The event to scroll to or a |
options | Object | How to scroll. |
options.block | String | How far to scroll the target: |
options.edgeOffset | Number | edgeOffset A margin around the target to bring into view. |
options.animate | Object | Boolean | Number | Set to |
options.animate.duration | Number | The number of milliseconds to animate over. |
options.animate.easing | String | The name of an easing function. |
options.highlight | Boolean | function | Set to |
options.focus | Boolean | Set to |
options.y | Boolean | Pass as |
A promise which is resolved when the target has been scrolled into view.
When an EventStore arrives, chain off a slave store from that which we can then filter to only show the week we are focused upon.
Configuration
Events
Getters
Misc
Rendering
Rows
Scrolling
Selection
Widget hierarchy
Events
56
Events
56Event handlers
56
Event handlers
56Typedefs
18
Typedefs
18CSS variables
86
CSS variables
86| Name | Description |
|---|---|
--b-event-list-day-selector-selected-date-background | Selected date's background color in the day selector |
--b-event-list-day-selector-selected-date-color | Selected date's color in the day selector |
--b-event-list-event-column-resource-row-gap | Gap between resource avatars |