ColumnModel
Represents a single column on a TaskBoard.
When creating a TaskBoard, you can either supply an initial set of columns or have the columns be loaded remotely as part of the Project data. These columns are either defined as plain strings, ColumnModel data objects or ColumnModel records (or a mix thereof). When using strings, the string will be used as is as the column's id and capitalized as its text.
const doneColumn = new ColumnModel({
id : 'done',
text : 'Done'
});
const taskBoard = new TaskBoard({
columns : [
// String, equal to passing { id : 'todo', text : 'Todo' }
'todo',
// Data object, in this case with a fixed width and not collapsible from the UI
{ id : 'doing', text : 'Doing', width : 200, collapsible : false }
// Record, not commonly used since it is easier to supply the data object directly
doneColumn
]
});
Loading Columns remotely
const taskBoard = new TaskBoard({
// Project will load columns, tasks, resources and assignments
project : {
loadUrl : 'data/data.json',
autoLoad : true
}
});
data.json
{
"success" : true,
"columns" : {
"rows" : [
{
"id" : "todo",
"text" : "Todo"
},
{
"id" : "doing",
"text" : "Doing",
"tasksPerRow" : 2
},
{
"id" : "review",
"text" : "Review",
"tasksPerRow" : 2
},
{
"id" : "done",
"text" : "Done",
"tasksPerRow" : 2
}
]
}
}
You can see this in action in the columns-remote demo in the examples folder.
Properties
63
Properties
63Class hierarchy
Other
Editing
JSON
Parent & children
Functions
56
Functions
56Expand/collapse
Collapse this column.
Uses a transition by default, await the call to be certain that it has finished.
A promise which is resolved when the column is collapsed
Expand this column.
Uses a transition by default, await the call to be certain that it has finished.
A promise which is resolved when the column is expanded
Configuration
Editing
Events
Other
Parent & children
Typedefs
1
Typedefs
1Fields
16
Fields
16Allow collapsing this column
Color, named colors are applied as a b-color-{color} (for example b-color-red) CSS class to the column.
Colors specified as hex, rgb() etc. are also accepted.
By default it does not visually affect the UI, but it applies a primary color (sets the --b-primary CSS
variable) to the column that applications can leverage to style it in the desired way.
Using named colors:
const taskBoard = new TaskBoard({
columns : [
{ id : 'todo', text : 'Todo', color : 'orange', tooltip : 'These are items to be done' }
]
});
Will result in:
<div class="b-task-board-column b-color-orange">
Which can the be used for example like:
.b-task-board-column-header {
border-left : 5px solid var(--b-primary);
}
Using non-named colors:
const taskBoard = new TaskBoard({
columns : [
{ id : 'todo', text : 'Todo', color : 'hsl(229deg 66% 42%)' }
]
});
Will result in:
<div class="b-task-board-column" style="--b-primary: hsl(229deg 66% 42%)">
Predefined named colors:
If 'true', a filter icon is displayed in the column header, allowing the user to do complex filter operations on the column's tasks. Requires the ColumnFilter feature to be enabled.
Column flex, affects width.
By default, the header text is HTML-encoded. Set this flag to false to disable this and allow html
elements in the column header
This column's unique id, used to match a task to a column (which field on a task to match is specified using then columnField config on TaskBoard).
Set to 'start' or 'end' to lock the column on the inline start or end side (left or right for LTR, vice versa
for RTL) of other columns, otherwise set to null to do not lock the column.
Column min-width in px. To override the default min-width specified in CSS.
If 'true', a search field is displayed in the column header, allowing the user to quick filter the column's tasks. Requires the FilterBar feature to be enabled.
If 'true', a sort icon is displayed in the column header, allowing the user to sort the tasks. Requires the ColumnSort feature to be enabled.
Number of tasks per row to display in this column. Leave blank to use the setting from the tasksPerRow config on TaskBoard.
Text displayed in the column header.
A tooltip string to show when hovering the column header
Column width in px.