TimelineViewPresets
Configs
3
Configs
3Common
An array of ViewPreset config objects which describes the available timeline layouts for this scheduler.
By default, a predefined set is loaded from the PresetManager.
A ViewPreset describes the granularity of the timeline view and the layout and subdivisions of the timeline header.
A string key used to lookup a predefined ViewPreset (e.g. 'weekAndDay', 'hourAndDay'), managed by PresetManager. See PresetManager for more information. Or a config object for a viewPreset.
Options:
- 'secondAndMinute'
- 'minuteAndHour'
- 'hourAndDay'
- 'dayAndWeek'
- 'dayAndMonth'
- 'weekAndDay'
- 'weekAndMonth',
- 'monthAndYear'
- 'year'
- 'manyYears'
- 'weekAndDayLetter'
- 'weekDateAndMonth'
- 'day'
- 'week'
If passed as a config object, the settings from the viewPreset with the provided base property will be used along
with any overridden values in your object.
To override:
viewPreset : {
base : 'hourAndDay',
id : 'myHourAndDayPreset',
headers : [
{
unit : "hour",
increment : 12,
renderer : (startDate, endDate, headerConfig, cellIdx) => {
return "";
}
}
]
}
or set a new valid preset config if the preset is not registered in the PresetManager.
When you use scheduler in weekview mode, this config is used to pick view preset. If passed view preset is not supported by weekview (only 2 supported by default - 'day' and 'week') default preset will be used - 'week'.
Scheduled events
Defines how dates will be formatted in tooltips etc. This config has priority over similar config on the view preset. For allowed values see format.
By default, this is ingested from ViewPreset upon change of ViewPreset (Such as when zooming in or out). But Setting this to your own value, overrides that behaviour.
Properties
5
Properties
5Common
Get the PresetStore created for the Scheduler, or set an array of ViewPreset config objects.
Get/set the current view preset
| Parameter | Type | Description |
|---|---|---|
viewPreset.options | ||
viewPreset.options.startDate | Date | A new start date for the time axis |
viewPreset.options.endDate | Date | A new end date for the time axis |
viewPreset.options.centerDate | Date | Where to center the new time axis |
viewPreset.options.scrollPosition | Number | The scroll position to scroll the new time axis to. This takes precedence over any date-scrolling. It is used when partnering two timelines which must be scroll-synced. |
Class hierarchy
Scheduled events
Defines how dates will be formatted in tooltips etc. This config has priority over similar config on the view preset. For allowed values see format.
By default, this is ingested from ViewPreset upon change of ViewPreset (Such as when zooming in or out). But Setting this to your own value, overrides that behaviour.
Events
2
Events
2Fired before the viewPreset is changed.
// Adding a listener using the "on" method
timelineViewPresets.on('beforePresetChange', ({ source, startDate, endDate, from, to }) => {
});| Parameter | Type | Description |
|---|---|---|
source | Scheduler | This Scheduler instance. |
startDate | Date | The new start date of the timeline. |
endDate | Date | The new end date of the timeline. |
from | ViewPreset | The outgoing ViewPreset. |
to | ViewPreset | The ViewPreset being switched to. |
Fired after the viewPreset has changed.
// Adding a listener using the "on" method
timelineViewPresets.on('presetChange', ({ source, startDate, centerDate, endDate, from, to }) => {
});| Parameter | Type | Description |
|---|---|---|
source | Scheduler | This Scheduler instance. |
startDate | Date | The new start date of the timeline. |
centerDate | Date | The new center date of the timeline. |
endDate | Date | The new end date of the timeline. |
from | ViewPreset | The outgoing ViewPreset. |
to | ViewPreset | The ViewPreset being switched to. |
Event handlers
2
Event handlers
2Called before the viewPreset is changed.
new TimelineViewPresets({
onBeforePresetChange({ source, startDate, endDate, from, to }) {
}
});| Parameter | Type | Description |
|---|---|---|
source | Scheduler | This Scheduler instance. |
startDate | Date | The new start date of the timeline. |
endDate | Date | The new end date of the timeline. |
from | ViewPreset | The outgoing ViewPreset. |
to | ViewPreset | The ViewPreset being switched to. |
Called after the viewPreset has changed.
new TimelineViewPresets({
onPresetChange({ source, startDate, centerDate, endDate, from, to }) {
}
});| Parameter | Type | Description |
|---|---|---|
source | Scheduler | This Scheduler instance. |
startDate | Date | The new start date of the timeline. |
centerDate | Date | The new center date of the timeline. |
endDate | Date | The new end date of the timeline. |
from | ViewPreset | The outgoing ViewPreset. |
to | ViewPreset | The ViewPreset being switched to. |