TaskBoardStores
Configs
6
Configs
6Data
Inline assignments, will be loaded into an internally created AssignmentStore as a part of a project.
Default values to apply to task records created by task boards features (such as the column header menu and the column toolbar)
A project config object or an instance that holds all stores and data used by the TaskBoard.
const taskBoard = new TaskBoard({
project : {
// Use a custom task model
taskModelClass : MyTaskModel,
// Supply inline data
tasks : [
{ id : 1, name: 'Task 1', ... },
...
]
});
Project has built-in crud manager functionality to handle syncing with a backend:
const taskBoard = new TaskBoard({
project : {
loadUrl : 'data/data.json'
},
autoLoad : true
});
Also has built-in state tracking manager functionality to handle undo/redo:
```javascript
const taskBoard = new TaskBoard({
stm : {
autoRecord : true,
disabled : false
}
});Inline resources, will be loaded into an internally created ResourceStore as a part of a project.
Properties
6
Properties
6Common
The ProjectModel instance, containing the data visualized by the TaskBoard.
Class hierarchy
Data
Inline assignments, will be loaded into an internally created AssignmentStore as a part of a project.
Inline resources, will be loaded into an internally created ResourceStore as a part of a project.
Functions
2
Functions
2Add a new task to the specified column / swimlane intersection (swimlane is optional), scroll it into view and start editing it (if an editing feature is enabled).
By default the task is created using the data defined in the newTaskDefaults combined with values
for the columnField, the swimlaneField and a generated weight to place it last. To override these or to
supply your own values for any field, pass the taskData argument.
If project is configured to auto sync changes to backend, the sync request will be awaited before editing starts.
| Parameter | Type | Description |
|---|---|---|
columnRecord | ColumnModel | Column to add the task to |
swimlaneRecord | ColumnModel | Swimlane to add the task to |
taskData | Object | Data for the new task |
Removes one or more tasks from the linked task store (and thus the TaskBoard).
First fires a 'beforeTaskRemove' event, which is preventable and async. Return false or a promise that
resolves to false from a listener to prevent the operation.
taskBoard.on({
async beforeRemoveTask() {
const result = await askForConfirmation();
return result;
}
});
taskBoard.remove(myTask);
| Parameter | Type | Description |
|---|---|---|
taskRecord | TaskModel | TaskModel[] | A single task or an array thereof to remove from the task store. |
Returns true if the tasks were removed, false if the operation was prevented.
Events
1
Events
1Triggered when one or more tasks are to be removed by a call to removeTask().
The UI routes through removeTask() (currently only the task menu offers task removal), this event can be
used to add a confirmation flow or similar to those actions.
Return false or a promise that resolves to false in a listener to prevent removal.
taskBoard.on({
async beforeRemoveTask() {
const result = await askForConfirmation();
return result;
}
});
// Adding a listener using the "on" method
taskBoardStores.on('beforeTaskRemove', ({ source, taskRecords }) => {
});| Parameter | Type | Description |
|---|---|---|
source | TaskBoard | This TaskBoard |
taskRecords | TaskModel[] | Task records to be removed |
Event handlers
1
Event handlers
1Called when one or more tasks are to be removed by a call to removeTask().
The UI routes through removeTask() (currently only the task menu offers task removal), this event can be
used to add a confirmation flow or similar to those actions.
Return false or a promise that resolves to false in a listener to prevent removal.
taskBoard.on({
async beforeRemoveTask() {
const result = await askForConfirmation();
return result;
}
});
new TaskBoardStores({
onBeforeTaskRemove({ source, taskRecords }) {
}
});| Parameter | Type | Description |
|---|---|---|
source | TaskBoard | This TaskBoard |
taskRecords | TaskModel[] | Task records to be removed |