ScheduleContext
Feature
Allow visually selecting a schedule "cell" by clicking, or any other pointer gesture.
This feature is disabled by default
const scheduler = new Scheduler({
features : {
// Configure as a truthy value to enable the feature
scheduleContext : {
triggerEvent : 'hover',
renderer : (context, element) => {
element.innerText = '😎';
}
}
}
});
The contextual details are available in the context property.
Note that the context is cleared upon change of viewPreset such as when zooming in or out.
Multiple cell selection
The feature allows selecting multiple schedule cells (can be toggled with the multiSelect config). The selected cells are stored in the selectedCells collection. Selecting multiple cells can be done using the mouse by clicking while pressing the Shift key or using the keyboard (see next chapter for shortcuts). Also selection can be done programmatically by calling the selectCellRange method.
Keyboard navigation and cell selection
The feature also implements keyboard navigation across cells (can be toggled with keyNavigation config) and keyboard cell selection (can be toggled with multiSelect config).
When enabled it uses following default keyboard shortcuts:
| Keys | Action |
|---|---|
| ArrowUp | Focuses the cell above currently focused cell. |
| ArrowRight | Focuses the cell to the right of currently focused cell |
| ArrowDown | Focuses the cell below currently focused cell |
| ArrowLeft | Focuses the cell to the left of currently focused cell |
| Shift+ArrowUp | Extends the selection one row up from currently focused cell |
| Shift+ArrowRight | Extends the selection one column to the right from currently focused cell |
| Shift+ArrowDown | Extends the selection one row down from currently focused cell |
| Shift+ArrowLeft | Extends the selection one column to the left from currently focused cell |
| Escape | Clears cells selection |
Useful configs and functions
| Member | Description |
|---|---|
| activateOnEvent | DOM event that activates the context |
| shareWithEvent | Share context with event elements |
| beforeContextShow | Fires before context popup is shown |
| beforeSelectedContextsShow | Fires before multi-selection popup shows |
See also
- ScheduleMenu - Schedule context menu
- ScheduleTooltip - Schedule tooltip
- TimeSelection - Time range selection
Configs
Configs are options you supply in a configuration object when creating an instance of this class-
Enables multiple cell selection. Selected cells are stored in selectedCells collection.
-
Collection of selected cells.
-
The pointer event type to use to update the context. May be
'hover'to highlight the tick context when moving the mouse across the timeline. -
A widget config describing the widget to show in the context tick.
Has a corresponding runtime widget property.
Properties
Properties are getters/setters or publicly accessible variables on this class-
Identifies an object as an instance of ScheduleContext class, or subclass thereof.
-
The element which is used to highlight the context if a renderer is being used. This is created lazily, and is not created if a widget is configured.
-
The active context.
-
Identifies an object as an instance of ScheduleContext class, or subclass thereof.
-
Currently active timeline cell.
Functions
Functions are methods available for calling on the class-
clear( )
Clears the current visible context element