EventSelection

Configs

11

Configure as false to preserve selection when clicking the empty schedule area.

deselectOnClick: Boolean= false

Configure as true to deselect a selected event upon click.

eventSelectionDisabled: Boolean= false

Configure as true, or set property to true to disable event selection.

highlightPredecessors: Boolean= false

Configure as true, or set property to true to highlight dependent events as well when selecting an event.

highlightSuccessors: Boolean= false

Configure as true, or set property to true to highlight dependent events as well when selecting an event.

A template method (empty by default) allowing you to control if an event can be selected or not.

new Scheduler({
    isEventSelectable(event) {
        return event.startDate >= Date.now();
    }
})

This selection process is applicable to calendar too:

new Calendar({
    isEventSelectable(event) {
        return event.startDate >= Date.now();
    }
})
ParameterTypeDescription
eventEventModel

The event record

Returns: Boolean -

true if event can be selected, otherwise false

This flag controls whether Scheduler should preserve its selection of events when loading a new dataset (if selected event ids are included in the newly loaded dataset).

multiEventSelect: Boolean | Object

Configure as true to allow CTRL/CMD+click to select multiple events in the scheduler.

Or pass an object to control which modifier keys to use for multi selection.

ParameterTypeDescription
ctrlKeyBoolean

Set to true to use CTRL key for multi selection (CMD on Mac).

altKeyBoolean

Set to true to use ALT key for multi selection (Option on Mac)

shiftKeyBoolean

Set to true to use SHIFT key for multi selection

Set to false to not select the resource of the event when clicking an event bar.

Set to false to not select the row/resource when clicking the empty area in a time axis cell.

Configure as true to trigger selectionChange when removing a selected event/assignment.

Properties

7

Class hierarchy

isEventSelection: Boolean= truereadonly
Identifies an object as an instance of EventSelection class, or subclass thereof.
isEventSelection: Boolean= truereadonlystatic
Identifies an object as an instance of EventSelection class, or subclass thereof.

Selection

A template method (empty by default) allowing you to control if an event can be selected or not.

new Scheduler({
    isEventSelectable(event) {
        return event.startDate >= Date.now();
    }
})

This selection process is applicable to calendar too:

new Calendar({
    isEventSelectable(event) {
        return event.startDate >= Date.now();
    }
})
ParameterTypeDescription
eventEventModel

The event record

Returns: Boolean -

true if event can be selected, otherwise false

The events which are selected.

The events which are selected.

Set to false to not select the resource of the event when clicking an event bar.

Set to false to not select the row/resource when clicking the empty area in a time axis cell.

Functions

13

Deselects the passed event or assignment if it is selected.

ParameterTypeDescription
eventOrAssignmentEventModel | AssignmentModel

The event or assignment to deselect.

Deselects the passed assignment if it is selected.

ParameterTypeDescription
assignmentAssignmentModel

The assignment to deselect

eventEvent

If this method was invoked as a result of a user action, this is the DOM event that triggered it

Removes assignments from the selection.

ParameterTypeDescription
assignmentsAssignmentModel[]

Assignments to be deselected

Deselects the passed event if it is selected.

ParameterTypeDescription
eventEventModel

The event to deselect.

Removes events from the selection.

ParameterTypeDescription
eventsEventModel[]

Events or assignments to be deselected

Returns true if the assignment is selected.

ParameterTypeDescription
assignmentAssignmentModel

The assignment

Returns: Boolean -

Returns true if the assignment is selected

Returns true if the event is selected.

ParameterTypeDescription
eventEventModel

The event

Returns: Boolean -

Returns true if the event is selected

Selects the passed event or assignment if it is not selected. Selecting events results in all their assignments being selected.

ParameterTypeDescription
eventOrAssignmentEventModel | AssignmentModel

The event or assignment to select

preserveSelectionBoolean

Pass true to preserve any other selected events or assignments

Selects the passed assignment if it is not selected.

ParameterTypeDescription
assignmentAssignmentModel

The assignment to select

preserveSelectionBoolean

Pass true to preserve any other selected assignments

eventEvent

If this method was invoked as a result of a user action, this is the DOM event that triggered it

Adds assignments to the selection.

ParameterTypeDescription
assignmentsAssignmentModel[]

Assignments to be selected

Selects the passed event if it is not selected. Selecting an event will select all its assignments.

ParameterTypeDescription
eventEventModel

The event to select

preserveSelectionBoolean

Pass true to preserve any other selected events

Adds events to the selection.

ParameterTypeDescription
eventsEventModel[]

Events to be selected

preserveSelectionBoolean

Pass true to preserve any other selected events

Events

4

Fired any time there is a change to the assignments selected in the Scheduler.

// Adding a listener using the "on" method
eventSelection.on('assignmentSelectionChange', ({ source, action, selected, deselected, selection }) => {

});
ParameterTypeDescription
sourceScheduler

This Scheduler instance.

actionselect | deselect | update | clear

One of the actions 'select', 'deselect', 'update', 'clear'

selectedAssignmentModel[]

An array of the Assignments added to the selection.

deselectedAssignmentModel[]

An array of the Assignments removed from the selection.

selectionAssignmentModel[]

The new selection.

Fired any time there is going to be a change to the assignments selected in the Scheduler. Returning false prevents the change

// Adding a listener using the "on" method
eventSelection.on('beforeAssignmentSelectionChange', ({ source, action, selected, deselected, selection }) => {

});
ParameterTypeDescription
sourceScheduler

This Scheduler instance.

actionselect | deselect | update | clear

One of the actions 'select', 'deselect', 'update', 'clear'

selectedAssignmentModel[]

An array of assignments that will be added to the selection.

deselectedAssignmentModel[]

An array of assignments that will be removed from the selection.

selectionAssignmentModel[]

The currently selected assignments, before applying selected and deselected.

Fired any time there is going to be a change to the events selected in the Scheduler. Returning false prevents the change

// Adding a listener using the "on" method
eventSelection.on('beforeEventSelectionChange', ({ source, action, selected, deselected, selection }) => {

});
ParameterTypeDescription
sourceScheduler

This Scheduler instance.

actionselect | deselect | update | clear

One of the actions 'select', 'deselect', 'update', 'clear'

selectedEventModel[]

An array of events that will be added to the selection.

deselectedEventModel[]

An array of events that will be removed from the selection.

selectionEventModel[]

The currently selected events, before applying selected and deselected.

Fired any time there is a change to the events selected in the Scheduler.

// Adding a listener using the "on" method
eventSelection.on('eventSelectionChange', ({ source, action, selected, deselected, selection }) => {

});
ParameterTypeDescription
sourceScheduler

This Scheduler instance.

actionselect | deselect | update | clear

One of the actions 'select', 'deselect', 'update', 'clear'

selectedEventModel[]

An array of the Events added to the selection.

deselectedEventModel[]

An array of the Event removed from the selection.

selectionEventModel[]

The new selection.

Event handlers

4

Called any time there is a change to the assignments selected in the Scheduler.

new EventSelection({
    onAssignmentSelectionChange({ source, action, selected, deselected, selection }) {

    }
});
ParameterTypeDescription
sourceScheduler

This Scheduler instance.

actionselect | deselect | update | clear

One of the actions 'select', 'deselect', 'update', 'clear'

selectedAssignmentModel[]

An array of the Assignments added to the selection.

deselectedAssignmentModel[]

An array of the Assignments removed from the selection.

selectionAssignmentModel[]

The new selection.

Called any time there is going to be a change to the assignments selected in the Scheduler. Returning false prevents the change

new EventSelection({
    onBeforeAssignmentSelectionChange({ source, action, selected, deselected, selection }) {

    }
});
ParameterTypeDescription
sourceScheduler

This Scheduler instance.

actionselect | deselect | update | clear

One of the actions 'select', 'deselect', 'update', 'clear'

selectedAssignmentModel[]

An array of assignments that will be added to the selection.

deselectedAssignmentModel[]

An array of assignments that will be removed from the selection.

selectionAssignmentModel[]

The currently selected assignments, before applying selected and deselected.

Called any time there is going to be a change to the events selected in the Scheduler. Returning false prevents the change

new EventSelection({
    onBeforeEventSelectionChange({ source, action, selected, deselected, selection }) {

    }
});
ParameterTypeDescription
sourceScheduler

This Scheduler instance.

actionselect | deselect | update | clear

One of the actions 'select', 'deselect', 'update', 'clear'

selectedEventModel[]

An array of events that will be added to the selection.

deselectedEventModel[]

An array of events that will be removed from the selection.

selectionEventModel[]

The currently selected events, before applying selected and deselected.

Called any time there is a change to the events selected in the Scheduler.

new EventSelection({
    onEventSelectionChange({ source, action, selected, deselected, selection }) {

    }
});
ParameterTypeDescription
sourceScheduler

This Scheduler instance.

actionselect | deselect | update | clear

One of the actions 'select', 'deselect', 'update', 'clear'

selectedEventModel[]

An array of the Events added to the selection.

deselectedEventModel[]

An array of the Event removed from the selection.

selectionEventModel[]

The new selection.