TaskSelection

Configs

2

Common

Selection

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

new TaskBoard({
    isTaskSelectable(taskRecord) {
        return taskRecord.status !== 'done';
    }
})
ParameterTypeDescription
taskRecordTaskModel

The task record

Returns: Boolean -

true if the task can be selected, otherwise false

Properties

4

Common

Class hierarchy

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

Selection

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

new TaskBoard({
    isTaskSelectable(taskRecord) {
        return taskRecord.status !== 'done';
    }
})
ParameterTypeDescription
taskRecordTaskModel

The task record

Returns: Boolean -

true if the task can be selected, otherwise false

Functions

4

Deselect all tasks.

Deselect the supplied task.

ParameterTypeDescription
taskRecordTaskModel

Check if the supplied task is selected or not

ParameterTypeDescription
taskRecordTaskModel
Returns: Boolean -

Returns true if it is selected, false if not

Select the supplied task, deselecting any previously selected by default.

ParameterTypeDescription
taskRecordTaskModel

Task to select

addBoolean

Specify true to add to selection instead of replacing it

Events

1

Triggered when task selection changes.

// Adding a listener using the "on" method
taskSelection.on('selectionChange', ({ source, action, selection, select, deselect }) => {

});
ParameterTypeDescription
sourceTaskBoard

TaskBoard instance

actionselect | deselect

Either 'select' or 'deselect', depending on operation

selectionTaskModel[]

All currently selected tasks

selectTaskModel[]

Tasks selected by the operation

deselectTaskModel[]

Tasks deselected by the operation

Event handlers

1

Called when task selection changes.

new TaskSelection({
    onSelectionChange({ source, action, selection, select, deselect }) {

    }
});
ParameterTypeDescription
sourceTaskBoard

TaskBoard instance

actionselect | deselect

Either 'select' or 'deselect', depending on operation

selectionTaskModel[]

All currently selected tasks

selectTaskModel[]

Tasks selected by the operation

deselectTaskModel[]

Tasks deselected by the operation