TaskItems
Configs
4
Configs
4Items to add to each card's body.
Supplied keys are used to bind to a field on the task record, supplied values are used to configure the items.
You are always required to supply a type, see the docs for each item type for more information on available
configs.
const taskBoard = new TaskBoard({
bodyItems : {
status : { type : 'text' }
}
});
For more information, see the class description above.
Items to add to each card's header.
Supplied keys are used to bind to a field on the task record, supplied values are used to configure the items.
You are always required to supply a type, see the docs for each item type for more information on available
configs.
const taskBoard = new TaskBoard({
headerItems : {
status : { type : 'text' }
}
});
For more information, see the class description above.
A function called on each render before adding items to a tasks card, allowing runtime manipulation of them.
const taskBoard = new TaskBoard({
processItems({ bodyItems, taskRecord }) {
// Remove the progress item for done tasks
if (taskRecord.status === 'done') {
bodyItems.progress = null;
}
}
});
NOTE: The function is only intended for manipulating the passed items, you should not update the passed
taskRecord in it since updating records triggers another round of rendering.
| Parameter | Type | Description |
|---|---|---|
context | Object | |
context.headerItems | Object<String, TaskItemOptions> | Item config objects for the task header, keyed by ref |
context.bodyItems | Object<String, TaskItemOptions> | Item config objects for the task body, keyed by ref |
context.footerItems | Object<String, TaskItemOptions> | Item config objects for the task footer, keyed by ref |
context.taskRecord | TaskModel | Record representing task to be rendered |
Returning false from this function prevents the menu being shown
Properties
5
Properties
5Class hierarchy
Task content
Items to add to each card's body.
As an object keyed by field names, values are TaskItem configs.
Reassigning this property merges the supplied object with the configured items:
const taskBoard = new TaskBoard({
bodyItems : {
status : { type : 'text' }
}
});
taskBoard.bodyItems = {
status : { hidden : true },
tags : { type : 'tags' }
};
// Results in:
//
// bodyItems = {
// status : { type : 'text', hidden: true }
// tags : { type : 'tags' }
// }
}
Items in card header.
As an object keyed by field names, values are TaskItem configs.
Reassigning this property merges the supplied object with the configured items:
const taskBoard = new TaskBoard({
headerItems : {
status : { type : 'text' }
}
});
taskBoard.headerItems = {
status : { hidden : true },
tags : { type : 'tags' }
};
// Results in:
//
// headerItems = {
// status : { type : 'text', hidden: true }
// tags : { type : 'tags' }
// }
}