SwimlaneModel

Represents a single swimlane on a TaskBoard.

When creating a TaskBoard, you can optionally supply an initial set of swimlanes. These are either defined as plain strings, SwimlaneModel data objects or SwimlaneModel records (or a mix thereof). When using strings, the string will be used as is as the swimlane's id and capitalized as its text.

const highPrio = new SwimlaneModel({
    id   : 'high',
    text : 'High prio'
});

const taskBoard = new TaskBoard({
    swimlanes : [
        // String, equal to passing { id : 'low', text : 'Low' }
        'low',
        // Data object, in this case with a fixed height and not collapsible from the UI
        { id : 'medium', text : 'Medium', height : 200, collapsible : false }
        // Record, not commonly used since it is easier to supply the data object directly
        highPrio
    ]
});

Properties

63

Class hierarchy

isSwimlaneModel: Boolean= truereadonly
Identifies an object as an instance of SwimlaneModel class, or subclass thereof.
isSwimlaneModel: Boolean= truereadonlystatic
Identifies an object as an instance of SwimlaneModel class, or subclass thereof.
isModelModel
isModelLinkModelLink
isModelStmModelStm
isTreeNodeTreeNode

Other

tasks: TaskModel[]readonly

Get tasks in this swimlane.

$namestaticModel
relationsstaticModel

Editing

copyOfModel
isValidModel

Fields

allFieldsstaticModel
autoExposeFieldsstaticModel
childrenFieldstaticModel
defaultsstaticModel
fieldMapstaticModel
fieldsstaticModel
idFieldstaticModel

Grouping

Identification

keyModel

JSON

jsonModel

Lifecycle

configBase

Linked records

hasLinksModelLink
isLinkedModelLink
recordLinksModelLink

Misc

stmModelStm

Parent & children

allChildrenTreeNode
childLevelTreeNode
firstChildTreeNode
isLeafTreeNode
isLoadedTreeNode
isParentTreeNode
isRootTreeNode
lastChildTreeNode
nextSiblingTreeNode
parentTreeNode
parentIdTreeNode

Functions

56

Expand/collapse

Collapse this swimlane.

Uses a transition by default, await the call to be certain that it has finished.

Returns: Promise -

A promise which is resolved when the column is collapsed

Expand this swimlane.

Uses a transition by default, await the call to be certain that it has finished.

Returns: Promise -

A promise which is resolved when the column is expanded

Configuration

applyDefaultsstaticBase

Editing

copyModel
getDataModel
removeModel
setModel

Events

Fields

addFieldstaticModel
getModel
processFieldstaticModel
removeFieldstaticModel

Identification

asIdstaticModel
generateIdstaticModel

JSON

toJSONModel

Lifecycle

destroystaticBase

Misc

equalsModel
initClassstaticBase
isOfTypeNamestaticBase
linkModelLink
mixinstaticBase

Other

Parent & children

appendChildTreeNode
bubbleTreeNode
bubbleWhileTreeNode
containsTreeNode
insertChildTreeNode
isExpandedTreeNode
removeChildTreeNode
traverseTreeNode

Typedefs

1

Fields

9
collapsed: Booleanreadonly

Collapsed (true) or expanded (False).

To expand or collapse, use TaskBoards expand and collapse functions.

collapsible: Boolean

Allow collapsing this swimlane

color: red | pink | magenta | purple | violet | deep-purple | indigo | blue | light-blue | cyan | teal | green | light-green | lime | yellow | orange | amber | deep-orange | light-gray | gray | String | null

Color, named colors are applied as a b-color-{color} (for example b-color-red) CSS class to the swimlane. 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 swimlane that applications can leverage to style it in the desired way.

Using named colors:

const taskBoard = new TaskBoard({
    swimlanes : [
        { id : 'high', text : 'High', color : 'red' }
    ]
});

Will result in:

<div class="b-task-board-swimlane b-color-red">

Which can the be used for example like:

.b-task-board-swimlane-header {
    border-left : 5px solid var(--b-primary);
}

Using non-named colors:

const taskBoard = new TaskBoard({
    swimlanes : [
        { id : 'high', text : 'High', color : 'hsl(229deg 66% 42%)' }
    ]
});

Will result in:

<div class="b-task-board-swimlane" style="--b-primary: hsl(229deg 66% 42%)">

Predefined named colors:

red
pink
magenta
purple
violet
deep-purple
indigo
blue
light-blue
cyan
teal
green
light-green
lime
yellow
orange
amber
deep-orange
light-gray
gray
flex: Number

Swimlane flex, affects height.

height: Number

Swimlane height in px.

hidden: Boolean

Set to true to hide the swimlane, false to show it again.

id: String | Number

The swimlane's unique id, used to match a task to a swimlane (which field on a task to match is specified using then swimlaneField config on TaskBoard).

tasksPerRow: Number

Number of tasks per row to display in this swimlane. Leave blank to use the setting from the tasksPerRow config on TaskBoard.

text: String

Text displayed in the swimlane header.