EventSelection
Configs
11
Configs
11Configure as false to preserve selection when clicking the empty schedule area.
Configure as true to deselect a selected event upon click.
Configure as true, or set property to true to disable event selection.
Configure as true, or set property to true to highlight dependent events as well when selecting an event.
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();
}
})
| Parameter | Type | Description |
|---|---|---|
event | EventModel | The event record |
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).
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.
| Parameter | Type | Description |
|---|---|---|
ctrlKey | Boolean | Set to |
altKey | Boolean | Set to |
shiftKey | Boolean | Set to |
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
Properties
7Class hierarchy
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();
}
})
| Parameter | Type | Description |
|---|---|---|
event | EventModel | The event record |
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 row/resource when clicking the empty area in a time axis cell.
Functions
13
Functions
13Deselects all events and assignments.
Deselects the passed event or assignment if it is selected.
| Parameter | Type | Description |
|---|---|---|
eventOrAssignment | EventModel | AssignmentModel | The event or assignment to deselect. |
Deselects the passed assignment if it is selected.
| Parameter | Type | Description |
|---|---|---|
assignment | AssignmentModel | The assignment to deselect |
event | Event | 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.
| Parameter | Type | Description |
|---|---|---|
assignments | AssignmentModel[] | Assignments to be deselected |
Deselects the passed event if it is selected.
| Parameter | Type | Description |
|---|---|---|
event | EventModel | The event to deselect. |
Removes events from the selection.
| Parameter | Type | Description |
|---|---|---|
events | EventModel[] | Events or assignments to be deselected |
Returns true if the assignment is selected.
| Parameter | Type | Description |
|---|---|---|
assignment | AssignmentModel | The assignment |
Returns true if the assignment is selected
Returns true if the event is selected.
| Parameter | Type | Description |
|---|---|---|
event | EventModel | The event |
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.
| Parameter | Type | Description |
|---|---|---|
eventOrAssignment | EventModel | AssignmentModel | The event or assignment to select |
preserveSelection | Boolean | Pass |
Selects the passed assignment if it is not selected.
| Parameter | Type | Description |
|---|---|---|
assignment | AssignmentModel | The assignment to select |
preserveSelection | Boolean | Pass |
event | Event | 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.
| Parameter | Type | Description |
|---|---|---|
assignments | AssignmentModel[] | Assignments to be selected |
Selects the passed event if it is not selected. Selecting an event will select all its assignments.
| Parameter | Type | Description |
|---|---|---|
event | EventModel | The event to select |
preserveSelection | Boolean | Pass |
Adds events to the selection.
| Parameter | Type | Description |
|---|---|---|
events | EventModel[] | Events to be selected |
preserveSelection | Boolean | Pass |
Events
4
Events
4Fired 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 }) => {
});| Parameter | Type | Description |
|---|---|---|
source | Scheduler | This Scheduler instance. |
action | select | deselect | update | clear | One of the actions 'select', 'deselect', 'update', 'clear' |
selected | AssignmentModel[] | An array of the Assignments added to the selection. |
deselected | AssignmentModel[] | An array of the Assignments removed from the selection. |
selection | AssignmentModel[] | 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 }) => {
});| Parameter | Type | Description |
|---|---|---|
source | Scheduler | This Scheduler instance. |
action | select | deselect | update | clear | One of the actions 'select', 'deselect', 'update', 'clear' |
selected | AssignmentModel[] | An array of assignments that will be added to the selection. |
deselected | AssignmentModel[] | An array of assignments that will be removed from the selection. |
selection | AssignmentModel[] | The currently selected assignments, before applying |
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 }) => {
});| Parameter | Type | Description |
|---|---|---|
source | Scheduler | This Scheduler instance. |
action | select | deselect | update | clear | One of the actions 'select', 'deselect', 'update', 'clear' |
selected | EventModel[] | An array of events that will be added to the selection. |
deselected | EventModel[] | An array of events that will be removed from the selection. |
selection | EventModel[] | The currently selected events, before applying |
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 }) => {
});| Parameter | Type | Description |
|---|---|---|
source | Scheduler | This Scheduler instance. |
action | select | deselect | update | clear | One of the actions 'select', 'deselect', 'update', 'clear' |
selected | EventModel[] | An array of the Events added to the selection. |
deselected | EventModel[] | An array of the Event removed from the selection. |
selection | EventModel[] | The new selection. |
Event handlers
4
Event handlers
4Called any time there is a change to the assignments selected in the Scheduler.
new EventSelection({
onAssignmentSelectionChange({ source, action, selected, deselected, selection }) {
}
});| Parameter | Type | Description |
|---|---|---|
source | Scheduler | This Scheduler instance. |
action | select | deselect | update | clear | One of the actions 'select', 'deselect', 'update', 'clear' |
selected | AssignmentModel[] | An array of the Assignments added to the selection. |
deselected | AssignmentModel[] | An array of the Assignments removed from the selection. |
selection | AssignmentModel[] | 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 }) {
}
});| Parameter | Type | Description |
|---|---|---|
source | Scheduler | This Scheduler instance. |
action | select | deselect | update | clear | One of the actions 'select', 'deselect', 'update', 'clear' |
selected | AssignmentModel[] | An array of assignments that will be added to the selection. |
deselected | AssignmentModel[] | An array of assignments that will be removed from the selection. |
selection | AssignmentModel[] | The currently selected assignments, before applying |
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 }) {
}
});| Parameter | Type | Description |
|---|---|---|
source | Scheduler | This Scheduler instance. |
action | select | deselect | update | clear | One of the actions 'select', 'deselect', 'update', 'clear' |
selected | EventModel[] | An array of events that will be added to the selection. |
deselected | EventModel[] | An array of events that will be removed from the selection. |
selection | EventModel[] | The currently selected events, before applying |
Called any time there is a change to the events selected in the Scheduler.
new EventSelection({
onEventSelectionChange({ source, action, selected, deselected, selection }) {
}
});| Parameter | Type | Description |
|---|---|---|
source | Scheduler | This Scheduler instance. |
action | select | deselect | update | clear | One of the actions 'select', 'deselect', 'update', 'clear' |
selected | EventModel[] | An array of the Events added to the selection. |
deselected | EventModel[] | An array of the Event removed from the selection. |
selection | EventModel[] | The new selection. |