TaskBoardBase
Widget
A thin base class for TaskBoard. Does not include any features by default, allowing smaller custom-built bundles if used in place of TaskBoard.
NOTE: In most scenarios you probably want to use TaskBoard instead of TaskBoardBase.
Configs
Configs are options you supply in a configuration object when creating an instance of this class-
An object containing Feature configuration objects (or
trueif no configuration is required) keyed by the Feature class name in all lowercase.Setting this property has no effect when using framework wrappers.When using framework wrappers, features must be configured via
featureNameFeatureproperties. See Framework Integration Guide for details. -
keyMap : Object<String, KeyMapConfig>
See Keyboard shortcuts for details
-
Path to load resource images from. Used by the for example the resource picker in the task editor and by the ResourceAvatars task item. Set this to display miniature images for each resource using their
imagefield.NOTE: The path should end with a
/:new TaskBoard({ resourceImagePath : 'images/resources/' }); -
Show task count for a column in its header, appended after the title
new TaskBoard({ showCountInHeader : false }); -
Makes column and swimlane headers sticky
new TaskBoard({ stickyHeaders : true }); -
Setting this will cause cards to expand to share the available width if there are fewer than tasksPerRow.
By default, the tasksPerRow always applies, and if it is 3, then a single card in a column will be 33% of the available width.
To have fewer cards than the tasksPerRow evenly share available column width, configure this as
true;Has a corresponding runtime stretchCards property.
-
Controls how many cards are rendered to a row in each column. Can be controlled on a per column basis by setting tasksPerRow
new TaskBoard({ tasksPerRow : 3 }); -
A function which renders the text, HTML, or
DomConfigobject to show as the column title. If you provide aDomConfigobject, it will replace the title element and you are responsible for styling it + laying it out.new TaskBoard({ columnTitleRenderer({ columnRecord }) { const highPrioCount = columnRecord.taskStore.query(task => task.status === columnRecord.id && task.prio === 'high').length; return `${columnRecord.text} <span class="highprio-count">(${highPrioCount} high prio)</span>`; } })Parameters
- context : Object
Renderer context data
- columnRecord : ColumnModel
The column instance
Returns
- context : Object
-
An empty function by default, but provided so that you can override it. This function is called each time a swimlane is rendered into the task board. It allows you to manipulate the DOM config object used for the swimlane before it is synced to DOM, thus giving you control over styling and contents.
const taskBoard = new TaskBoard({ swimlaneRenderer({ swimlaneRecord, swimlaneConfig }) { // Add an icon to all swimlane headers swimlaneConfig.children.header.children.icon = { tag : 'i', class : 'fa fa-dog' } } });Parameters
- context : Object
An object containing the information needed to render a swimlane.
- swimlaneRecord : SwimlaneModel
The swimlane.
- swimlaneConfig : DomConfig
DOM config object for the swimlane
Returns
void - context : Object
-
Allows sorting tasks in the UI independent of how they are sorted in the task store.
Specify
trueto force sorting tasks by weight.Supply a sort function to force a custom sort order.
This is likely something you will want to use if combining TaskBoard with other products, sharing the project. Without this, sorting tasks in for example Gantt will also rearrange the cards on the board.
As described above it accepts either a boolean or a Function, but it always returns a sorter function.
-
CSS variable prefix, appended to the keys used in css.
Normally you do not need to change this value.
-
Experimental, animate actions that cannot be animated using CSS transitions. Currently includes:
- Programmatically moving tasks
- Moving tasks using the task editor
- Adding tasks
- Removing tasks
- Sorting tasks
- Hiding/showing/filtering columns
- Hiding/showing/filtering swimlanes
new TaskBoard({ useDomTransition : true });NOTE: This flag is not supported for Lightning Web Components
-
By default, the header text is HTML-encoded. Set this flag to
falsedisable this and allow html elements in the column headers. Can also be specified on a single column. -
Configuration values for the ScrollManager class. It is used to manage column/body scrolling during task, column or swimlane drag.
new TaskBoard({ scrollManager : { zoneWidth : 100, // increase zone size scrollSpeed : 3 // and scroll speed } }) -
An empty function by default, but provided so that you can override it. This function is called each time a task is rendered into the task board. It allows you to manipulate the DOM config object used for the card before it is synced to DOM, thus giving you control over styling and contents.
You should never modify any records inside this method.const taskBoard = new TaskBoard({ taskRenderer({ taskRecord, cardConfig }) { // Add an icon to all tasks header cardConfig.children.header.children.icon = { tag : 'i', class : 'fa fa-beer' } } });For more information, see the Customize task contents guide.
Parameters
- context : Object
An object containing the information needed to render a task
- taskRecord : TaskModel
The task record
- columnRecord : ColumnModel
The column the task will be displayed in
- swimlaneRecord : SwimlaneModel
The swimlane the task will be displayed in
- cardConfig : DomConfig
DOM config object for the cards element
Returns
void - context : Object
Properties
Properties are getters/setters or publicly accessible variables on this class-
Identifies an object as an instance of TaskBoardBase class, or subclass thereof.
-
Setting this will cause cards to expand to share the available width if there are fewer than tasksPerRow.
By default, the tasksPerRow always applies, and if it is 3, then a single card in a column will be 33% of the available width.
To have fewer cards than the tasksPerRow evenly share available column width, configure this as
true;Has a corresponding stretchCards config.
-
Identifies an object as an instance of TaskBoardBase class, or subclass thereof.
Functions
Functions are methods available for calling on the class-
Starts inline editing of the supplied task, optionally for a specific item on its card.
Added by the SimpleTaskEdit feature, only available when that feature is enabled.
Events
Events are triggered for certain actions in this class and can be listened for to react to those actions in your code-
Fires on the owning TaskBoard before column dragging starts. Return
falseto prevent the actionAdded by the ColumnDrag feature, only available when that feature is enabled.
columnDragStartFROM-FEATUREFires on the owning TaskBoard when column dragging starts
Added by the ColumnDrag feature, only available when that feature is enabled.
columnDragFROM-FEATUREFires on the owning TaskBoard when a column is dragged, if the drag leads to a change compared to the last columnDrag event.
Returning
falsefrom a listener will flag the drag as invalid (by default turning the drop indicator red)const taskBoard = new TaskBoard({ listeners : { // Do not allow moving beyond last column columnDrag({ columnRecord, beforeColumn }) { return beforeColumn === null; } } });Added by the ColumnDrag feature, only available when that feature is enabled.
columnDropFROM-FEATUREFires on the owning TaskBoard when a column is successfully dropped (after the drop transition has finished)
Added by the ColumnDrag feature, only available when that feature is enabled.
columnDragEndFROM-FEATUREFires on the owning TaskBoard when a previously started drag operation ends, no matter the outcome of it (whether valid, invalid or aborted)
Added by the ColumnDrag feature, only available when that feature is enabled.
Fires on the owning TaskBoard when dropping a column, before the operation completes. Handles async listeners, returning
falsefrom one will abort the operationconst taskBoard = new TaskBoard({ listeners : { async beforeColumnDrop({ columnRecord, beforeColumn }) { // Show confirmation dialog const result = await MessageDialog.confirm({ title : 'Verify drop', message : `Please confirm moving ${columnRecord.text} before ${beforeColumn.text}?` }); // Returning false will abort the drop (if user pressed Cancel) return result === MessageDialog.okButton; } } });Added by the ColumnDrag feature, only available when that feature is enabled.
columnDragAbortFROM-FEATUREFires on the owning TaskBoard when a drag operation is aborted (invalid drop or aborted using ESC)
Added by the ColumnDrag feature, only available when that feature is enabled.
columnFilterShowFROM-FEATURETriggered when the column filter is displayed.
Added by the ColumnFilter feature, only available when that feature is enabled.
columnFilterHideFROM-FEATURETriggered when the column filter is hidden.
Added by the ColumnFilter feature, only available when that feature is enabled.
columnFilterToggleFROM-FEATURETriggered when the column filter visibility is toggled.
Added by the ColumnFilter feature, only available when that feature is enabled.
This event fires on the owning TaskBoard before the menu is shown for a column header. Allows manipulation of the items to show in the same way as in the processItems.
Returning
falsefrom a listener prevents the menu from being shown.Added by the ColumnHeaderMenu feature, only available when that feature is enabled.
cellMenuShowFROM-FEATUREThis event fires on the owning TaskBoard after the context menu is shown for a column header.
Added by the ColumnHeaderMenu feature, only available when that feature is enabled.
cellMenuItemFROM-FEATUREThis event fires on the owning TaskBoard when an item is selected in the column header menu.
Added by the ColumnHeaderMenu feature, only available when that feature is enabled.
cellMenuToggleItemFROM-FEATUREThis event fires on the owning TaskBoard when a check item is toggled in the column header menu.
Added by the ColumnHeaderMenu feature, only available when that feature is enabled.
This event is fired prior to starting a column resize gesture. The resize is canceled if a listener returns
false.Added by the ColumnResize feature, only available when that feature is enabled.
columnResizeStartFROM-FEATUREThis event is fired when a column resize gesture starts.
Added by the ColumnResize feature, only available when that feature is enabled.
columnResizeFROM-FEATUREThis event is fired after a resize gesture is completed.
Added by the ColumnResize feature, only available when that feature is enabled.
Fires on the owning TaskBoard before displaying an inline editor. Returning
falsestops the editor from being shown.const taskBoard = new TaskBoard({ listeners : { beforeSimpleTaskEdit({ taskRecord }) { // Some condition for which editing should be blocked... if (taskRecord.disallowed) { return false; } } } });Added by the SimpleTaskEdit feature, only available when that feature is enabled.
Fires on the owning TaskBoard when inline editing of a field has successfully finished.
const taskBoard = new TaskBoard({ listeners : { simpleTaskEditComplete({ taskRecord, field }) { Toast.show(`Finished editing ${field} of ${taskRecord.name}`); } } });Added by the SimpleTaskEdit feature, only available when that feature is enabled.
Fires on the owning TaskBoard when inline editing of a field is cancelled (by pressing ESC).
const taskBoard = new TaskBoard({ listeners : { simpleTaskEditCancel({ taskRecord }) { Toast.show(`Aborted editing of ${taskRecord.name}`); } } });Added by the SimpleTaskEdit feature, only available when that feature is enabled.
Fires on the owning TaskBoard before task dragging starts. Return
falseto prevent the actionAdded by the TaskDrag feature, only available when that feature is enabled.
taskDragStartFROM-FEATUREFires on the owning TaskBoard when task dragging starts
Added by the TaskDrag feature, only available when that feature is enabled.
taskDragFROM-FEATUREFires on the owning TaskBoard when tasks are dragged, if the drag leads to any changes compared to the last taskDrag event (moved to a new column or changed order within a column).
Returning
falsefrom a listener will flag the drag as invalid (by default turning the drop indicator red)Added by the TaskDrag feature, only available when that feature is enabled.
Fires on the owning TaskBoard when tasks are dropped, before the operation completes. Handles async listeners, returning
falsefrom one will abort the operationconst taskBoard = new TaskBoard({ listeners : { async beforeTaskDrop({ taskRecords, targetColumn }) { // Show confirmation dialog const result = await MessageDialog.confirm({ title : 'Verify drop', message : `Please confirm moving ${taskRecords.map(t => `"${t.name}"`).join(', ')} to ${targetColumn.text}?` }); // Returning false will abort the drop (if user pressed Cancel) return result === MessageDialog.okButton; } } });Added by the TaskDrag feature, only available when that feature is enabled.
taskDropFROM-FEATUREFires on the owning TaskBoard when tasks are successfully dropped (after the drop transition has finished)
Added by the TaskDrag feature, only available when that feature is enabled.
taskDragEndFROM-FEATUREFires on the owning TaskBoard when a previously started drag operation ends, no matter the outcome of it (whether valid, invalid or aborted)
Added by the TaskDrag feature, only available when that feature is enabled.
taskDragAbortFROM-FEATUREFires on the owning TaskBoard when a drag operation is aborted (invalid drop or aborted using ESC)
Added by the TaskDrag feature, only available when that feature is enabled.
Fires on the owning TaskBoard before a task is displayed in an editor.
Returning
falseor a promise that resolves tofalsestops the default editing UI from being shown.taskBoard.on({ beforeTaskEdit({ taskRecord }) { return await userCanEdit(taskRecord); } }Added by the TaskEdit feature, only available when that feature is enabled.
beforeTaskEditShowFROM-FEATUREFires on the owning TaskBoard when the editor for a task is available, but before it is populated with data and shown. Allows manipulating fields etc.
taskBoard.on({ beforeTaskEditShow({ taskRecord, editor }) { editor.title = `Editing "${taskRecord.name}"`; } }Added by the TaskEdit feature, only available when that feature is enabled.
Fires on the owning TaskBoard when the editor for a task is closed. Consumed internally by FilterBar to restore highlighting of matches.
Added by the TaskEdit feature, only available when that feature is enabled.
This event fires on the owning TaskBoard before the context menu is shown for a task. Allows manipulation of the items to show in the same way as in the processItems.
Returning
falsefrom a listener prevents the menu from being shown.Added by the TaskMenu feature, only available when that feature is enabled.
taskMenuShowFROM-FEATUREThis event fires on the owning TaskBoard after the context menu is shown for a task.
Added by the TaskMenu feature, only available when that feature is enabled.
taskMenuItemFROM-FEATUREThis event fires on the owning TaskBoard when an item is selected in the task context menu.
Added by the TaskMenu feature, only available when that feature is enabled.
taskMenuToggleItemFROM-FEATUREThis event fires on the owning TaskBoard when a check item is toggled in the task context menu.
Added by the TaskMenu feature, only available when that feature is enabled.
Event handlers
Event handlers are callbacks called as a result of certain actions in this class-
Called on the owning TaskBoard before column dragging starts. Return
falseto prevent the actionAdded by the ColumnDrag feature, only available when that feature is enabled.
onColumnDragStartFROM-FEATURECalled on the owning TaskBoard when column dragging starts
Added by the ColumnDrag feature, only available when that feature is enabled.
onColumnDragFROM-FEATURECalled on the owning TaskBoard when a column is dragged, if the drag leads to a change compared to the last columnDrag event.
Returning
falsefrom a listener will flag the drag as invalid (by default turning the drop indicator red)const taskBoard = new TaskBoard({ listeners : { // Do not allow moving beyond last column columnDrag({ columnRecord, beforeColumn }) { return beforeColumn === null; } } });Added by the ColumnDrag feature, only available when that feature is enabled.
onColumnDropFROM-FEATURECalled on the owning TaskBoard when a column is successfully dropped (after the drop transition has finished)
Added by the ColumnDrag feature, only available when that feature is enabled.
onColumnDragEndFROM-FEATURECalled on the owning TaskBoard when a previously started drag operation ends, no matter the outcome of it (whether valid, invalid or aborted)
Added by the ColumnDrag feature, only available when that feature is enabled.
Called on the owning TaskBoard when dropping a column, before the operation completes. Handles async listeners, returning
falsefrom one will abort the operationconst taskBoard = new TaskBoard({ listeners : { async beforeColumnDrop({ columnRecord, beforeColumn }) { // Show confirmation dialog const result = await MessageDialog.confirm({ title : 'Verify drop', message : `Please confirm moving ${columnRecord.text} before ${beforeColumn.text}?` }); // Returning false will abort the drop (if user pressed Cancel) return result === MessageDialog.okButton; } } });Added by the ColumnDrag feature, only available when that feature is enabled.
onColumnDragAbortFROM-FEATURECalled on the owning TaskBoard when a drag operation is aborted (invalid drop or aborted using ESC)
Added by the ColumnDrag feature, only available when that feature is enabled.
onColumnFilterShowFROM-FEATURECalled when the column filter is displayed.
Added by the ColumnFilter feature, only available when that feature is enabled.
onColumnFilterHideFROM-FEATURECalled when the column filter is hidden.
Added by the ColumnFilter feature, only available when that feature is enabled.
onColumnFilterToggleFROM-FEATURECalled when the column filter visibility is toggled.
Added by the ColumnFilter feature, only available when that feature is enabled.
This handler is called on the owning TaskBoard before the menu is shown for a column header. Allows manipulation of the items to show in the same way as in the processItems.
Returning
falsefrom a listener prevents the menu from being shown.Added by the ColumnHeaderMenu feature, only available when that feature is enabled.
onCellMenuShowFROM-FEATUREThis handler is called on the owning TaskBoard after the context menu is shown for a column header.
Added by the ColumnHeaderMenu feature, only available when that feature is enabled.
onCellMenuItemFROM-FEATUREThis handler is called on the owning TaskBoard when an item is selected in the column header menu.
Added by the ColumnHeaderMenu feature, only available when that feature is enabled.
onCellMenuToggleItemFROM-FEATUREThis handler is called on the owning TaskBoard when a check item is toggled in the column header menu.
Added by the ColumnHeaderMenu feature, only available when that feature is enabled.
This event is called prior to starting a column resize gesture. The resize is canceled if a listener returns
false.Added by the ColumnResize feature, only available when that feature is enabled.
onColumnResizeStartFROM-FEATUREThis event is called when a column resize gesture starts.
Added by the ColumnResize feature, only available when that feature is enabled.
onColumnResizeFROM-FEATUREThis event is called after a resize gesture is completed.
Added by the ColumnResize feature, only available when that feature is enabled.
Called on the owning TaskBoard before displaying an inline editor. Returning
falsestops the editor from being shown.const taskBoard = new TaskBoard({ listeners : { beforeSimpleTaskEdit({ taskRecord }) { // Some condition for which editing should be blocked... if (taskRecord.disallowed) { return false; } } } });Added by the SimpleTaskEdit feature, only available when that feature is enabled.
Called on the owning TaskBoard when inline editing of a field has successfully finished.
const taskBoard = new TaskBoard({ listeners : { simpleTaskEditComplete({ taskRecord, field }) { Toast.show(`Finished editing ${field} of ${taskRecord.name}`); } } });Added by the SimpleTaskEdit feature, only available when that feature is enabled.
Called on the owning TaskBoard when inline editing of a field is cancelled (by pressing ESC).
const taskBoard = new TaskBoard({ listeners : { simpleTaskEditCancel({ taskRecord }) { Toast.show(`Aborted editing of ${taskRecord.name}`); } } });Added by the SimpleTaskEdit feature, only available when that feature is enabled.
Called on the owning TaskBoard before task dragging starts. Return
falseto prevent the actionAdded by the TaskDrag feature, only available when that feature is enabled.
onTaskDragStartFROM-FEATURECalled on the owning TaskBoard when task dragging starts
Added by the TaskDrag feature, only available when that feature is enabled.
onTaskDragFROM-FEATURECalled on the owning TaskBoard when tasks are dragged, if the drag leads to any changes compared to the last taskDrag event (moved to a new column or changed order within a column).
Returning
falsefrom a listener will flag the drag as invalid (by default turning the drop indicator red)Added by the TaskDrag feature, only available when that feature is enabled.
Called on the owning TaskBoard when tasks are dropped, before the operation completes. Handles async listeners, returning
falsefrom one will abort the operationconst taskBoard = new TaskBoard({ listeners : { async beforeTaskDrop({ taskRecords, targetColumn }) { // Show confirmation dialog const result = await MessageDialog.confirm({ title : 'Verify drop', message : `Please confirm moving ${taskRecords.map(t => `"${t.name}"`).join(', ')} to ${targetColumn.text}?` }); // Returning false will abort the drop (if user pressed Cancel) return result === MessageDialog.okButton; } } });Added by the TaskDrag feature, only available when that feature is enabled.
onTaskDropFROM-FEATURECalled on the owning TaskBoard when tasks are successfully dropped (after the drop transition has finished)
Added by the TaskDrag feature, only available when that feature is enabled.
onTaskDragEndFROM-FEATURECalled on the owning TaskBoard when a previously started drag operation ends, no matter the outcome of it (whether valid, invalid or aborted)
Added by the TaskDrag feature, only available when that feature is enabled.
onTaskDragAbortFROM-FEATURECalled on the owning TaskBoard when a drag operation is aborted (invalid drop or aborted using ESC)
Added by the TaskDrag feature, only available when that feature is enabled.
Called on the owning TaskBoard before a task is displayed in an editor.
Returning
falseor a promise that resolves tofalsestops the default editing UI from being shown.taskBoard.on({ beforeTaskEdit({ taskRecord }) { return await userCanEdit(taskRecord); } }Added by the TaskEdit feature, only available when that feature is enabled.
onBeforeTaskEditShowFROM-FEATURECalled on the owning TaskBoard when the editor for a task is available, but before it is populated with data and shown. Allows manipulating fields etc.
taskBoard.on({ beforeTaskEditShow({ taskRecord, editor }) { editor.title = `Editing "${taskRecord.name}"`; } }Added by the TaskEdit feature, only available when that feature is enabled.
Called on the owning TaskBoard when the editor for a task is closed. Consumed internally by FilterBar to restore highlighting of matches.
Added by the TaskEdit feature, only available when that feature is enabled.
This handler is called on the owning TaskBoard before the context menu is shown for a task. Allows manipulation of the items to show in the same way as in the processItems.
Returning
falsefrom a listener prevents the menu from being shown.Added by the TaskMenu feature, only available when that feature is enabled.
onTaskMenuShowFROM-FEATUREThis handler is called on the owning TaskBoard after the context menu is shown for a task.
Added by the TaskMenu feature, only available when that feature is enabled.
onTaskMenuItemFROM-FEATUREThis handler is called on the owning TaskBoard when an item is selected in the task context menu.
Added by the TaskMenu feature, only available when that feature is enabled.
onTaskMenuToggleItemFROM-FEATUREThis handler is called on the owning TaskBoard when a check item is toggled in the task context menu.
Added by the TaskMenu feature, only available when that feature is enabled.
CSS variables
CSS variables that can be set to adjust appearanceSource path
TaskBoard/view/TaskBoardBase.js- Localizable
- Delayable
- Events
- Pluggable
- State
- KeyMap
- RTL
- Responsive
- Styleable
- Toolable
- CrudManagerView
- ExpandCollapse
- ResponsiveCards
- TaskBoardColumns
- TaskBoardDom
- TaskBoardDomEvents
- TaskBoardScroll
- TaskBoardStores
- TaskBoardSwimlanes
- TaskBoardVirtualization
- TaskHighlighting
- TaskItems
- TaskNavigation
- TaskSelection
Contents