v7.3.0

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

No results

Configs

Configs are options you supply in a configuration object when creating an instance of this class
  • Enables keyboard navigation across ticks.

  • Enables multiple cell selection. Selected cells are stored in selectedCells collection.

  • Collection of selected cells.

  • true to automatically enable tick cells navigation when focusing the timeaxis column

  • triggerEvent : 'click'/'hover'/'contextmenu'/'mousedown'click

    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
  • element : HTMLElement
    READONLY

    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.

  • isScheduleContext : Booleantrue
    READONLY
    ADVANCED
    Identifies an object as an instance of ScheduleContext class, or subclass thereof.
  • isNavigatingTimelineCells : Boolean
    READONLY
    ON-OWNER

    Indicates whether navigating in the TimeAxis column is started and the timeaxis column is focused

  • Currently active timeline cell.

Functions

Functions are methods available for calling on the class
    • clear( )

      Clears the current visible context element

    • Starts navigating the TimeAxis column cells (if the timeaxis column is focused)

    • Stops navigating the TimeAxis column cells

    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
    id: scheduleContext

    Source path

    Scheduler/feature/ScheduleContext.js

    Demo

    examples/schedule-context

    Contents