Skip to main content

API overview

Kanban constructor

new kanban.Kanban("#root", {
// configuration parameters
});

Parameters:

  • the HTML container (specified by the container's ID)
  • an object containing configuration options (see details)

Toolbar constructor

new kanban.Toolbar("#toolbar", {
// configuration parameters
});

Parameters:

  • the HTML container (specified by the container's ID)
  • an object containing configuration options (see details)

Kanban methods

NameDescription
addCard()Inserts a new card into the Kanban board
addColumn()Inserts a new column into the Kanban board
addComment()Inserts a new comment into the specified card using its ID
addLink()Inserts a new link into the Kanban board
addRow()Inserts a new row into the Kanban board
deleteCard()Deletes the specified card from the Kanban datastore.
deleteColumn()Deletes a specific column from the Kanban datastore
deleteComment()Removes a comment from a card by specifying its ID
deleteLink()Deletes a specific link from the Kanban datastore.
deleteRow()Deletes the specified row from the Kanban datastore.
destructor()Clears all HTML elements of the Kanban and removes all associated event handlers.
duplicateCard()Creates a copy of a card using its specified ID.
getAreaCards()Retrieves an array containing data objects for all cards within the specified column (and row, if provided).
getCard()Retrieves the data object of a card using its specified ID
getColumnCards()Retrieves an array containing data objects for all cards within a specified column
getSelection()Retrieves an array containing the ID(s) of the currently selected card(s).
moveCard()Moves a card to a specified column (and row)
moveColumn()Shifts a column to a new spot on the board.
moveRow()Shifts a row to a new position
parse()Loads data into the Kanban board
redo()Reapplies the action that was undone by the undo command
scroll()Moves the Kanban view to bring the specified element into focus.
selectCard()Highlights a card using the given ID.
serialize()Converts the Kanban data into a JSON format
setConfig()Updates the Kanban with new configuration settings
setEdit()Enables or disables the Kanban card editor
setLocale()Changes the locale settings for Kanban
setSearch()Finds cards based on the specified criteria
setSort()Organizes cards based on the given sorting criteria
undo()Reverts the last operation in Kanban
unselectCard()Deselects card(s) based on their ID
updateCard()Modifies the card data using its ID
updateColumn()Modifies the data of a column using its ID
updateComment()Modify a card comment by its ID
updateRow()Modifies the data of a row by its ID

Kanban internal API

Event Bus methods

NameDescription
api.detach()This method lets you remove or detach an event listener.
api.exec()This method lets you trigger internal events within the Kanban board.
api.intercept()Provides a way to capture and block internal events before they proceed.
api.on()Provides a way to attach handlers to internal events.
api.setNext()Enables adding an action into the Event Bus sequence

Export methods

NameDescription
export.json()Outputs Kanban data as a JSON file

State methods

NameDescription
api.getReactiveState()Retrieves an object containing the reactive properties of the Kanban board.
api.getState()Retrieves an object containing the StateStore properties of the Kanban board.
api.getStores()Retrieves an object containing the DataStore properties of the Kanban.

Kanban events

NameDescription
add-cardTriggered when a new card is added
add-columnTriggered when a new column is added
add-commentTriggered when a new comment is added
add-linkTriggered when a new link is added
add-rowTriggered when a new row is added
add-voteTriggered when a user casts a new vote
delete-cardThis event triggers when a card is removed.
delete-columnTriggered when a column is removed
delete-commentTriggered when a card comment is deleted
delete-linkTriggered when a link is removed
delete-rowTriggers when a row is being removed
delete-voteTriggered when a user removes a vote from a card
drag-cardTriggered when a card is moved using drag and drop
duplicate-cardTriggered when a card is duplicated
end-drag-cardTriggered when a card stops being dragged
move-cardTriggered when a card is moved
move-columnTriggered when a column is moved
move-rowTriggered when a row is moved
redoTriggered when an action that was undone gets repeated
scrollTriggered when scrolling to specific elements
select-cardTriggered when a card is selected
set-editTriggered when the editor is toggled
set-searchTriggered when a search is performed on cards
set-sortTriggered when cards are sorted
start-drag-cardTriggered when a card drag operation begins
undoTriggered when the last action in Kanban is undone
unselect-cardTriggered when a card is unselected
update-cardTriggered when card data is updated
update-columnTriggered when a column's data is updated
update-commentTriggered when a comment is updated
update-rowTriggered when a row's data is updated

Kanban properties

NameDescription
cardHeightOptional. Sets the height of the cards.
cardsOptional. An array of objects holding the cards data
cardShapeOptional. Settings object to customize the appearance of cards
cardTemplateOptional. Returns and applies a custom HTML template for the card.
columnKeyOptional. Specifies which column a card belongs to.
columnsOptional. An array of objects holding the columns data
columnShapeOptional. A settings object to customize the appearance of columns.
currentUserOptional. Specifies the ID of the current user.
editorOptional. Contains settings to customize the Kanban editor
editorShapeOptional. This is an array of objects that lets you control how the Kanban editor looks and works.
historyOptional. Turns history tracking on or off
linksOptional. This is an array of objects that holds the links data.
localeOptional. An object defining a custom locale for Kanban
readonlyOptional. Controls whether editing, adding, selecting, and dragging cards are enabled or disabled.
renderTypeOptional. Specifies the way cards are rendered.
rowKeyOptional. Specifies which row a card belongs to.
rowsOptional. An array of objects representing the rows (swimlanes) data.
rowShapeOptional. An object to customize how rows look and behave.
scrollTypeOptional. Specifies the scrolling behavior type

Toolbar methods

NameDescription
destructor()Clears all HTML elements of the Toolbar and detaches any associated events.
setConfig()Updates the Toolbar with new configuration settings.
setLocale()Updates the Toolbar of Kanban with a new locale

Toolbar properties

NameDescription
apiRequired. An object representing the internal API of Kanban.
itemsOptional. An array containing controls arranged on the Kanban Toolbar
localeOptional. An object defining a custom locale for the Toolbar

Common settings

NameDescription
$metaAn object containing extra settings to customize Kanban methods and events

RestDataProvider API

RestDataProvider methods

NameDescription
getCards()Retrieves a promise containing the cards data
getColumns()Retrieves a promise containing the columns data
getLinks()Retrieves a promise containing the links data
getRows()Retrieves a promise containing the rows data
getUsers()Retrieves a promise containing the users data
send()Sends an HTTP request to the server and returns a promise, which may include data depending on the request.

RestDataProvider routes

NameDescription
GET /cardsRetrieves data for all cards and returns a JSON object containing an array of card objects.
GET /columnsRetrieves data for all columns and returns a JSON object containing an array of column data objects.
GET /linksRetrieves data for all links and returns a JSON object containing an array of link objects.
GET /rowsRetrieves data for all rows and returns a JSON object containing an array of row (swimlane) data objects.
GET /usersRetrieves data for all users and returns a JSON object containing an array of user objects.
GET /uploadsRetrieves the specified binary file from the server
POST /cardsAdds a new card and responds with a json object containing the new card ID
POST /cards/{cardId}/commentsAdds one or more new comments to a card and returns a JSON object containing the ID of the newly added comment.
POST /cards/{cardId}/voteAdds a vote to the specified card and returns a JSON object containing the ID of the user who voted.
POST /columnsCreates a new column and returns a JSON object containing the column id.
POST /linksAdds a new link and returns a JSON object containing the newly created link ID.
POST /rowsAdds a new row and returns a JSON object containing the row ID.
POST /uploadsUploads a binary file to the server and returns a json object with the file id, name, and url
PUT /cardsUpdates the details of a specific card and returns an empty JSON object.
PUT /cards/{id}/moveMoves cards to a specified position
PUT /cards/{cardId}/comments/{cardId}Updates a comment within a card and returns a JSON object containing the ID of the updated comment.
PUT /columnsUpdates the details of a specified column and returns an empty JSON object.
PUT /columns/{id}/moveMoves a column to a specified position
PUT /rowsUpdates the data for a specific row (swimlane) and returns an empty JSON object.
PUT /rows/{id}/moveMoves a row to a new position
DELETE /cardsRemoves data from a card
DELETE /cards/{cardId}/comments/{cardId}Deletes a comment from a card
DELETE /cards/{cardId}/voteThis endpoint removes a vote from a specified card and responds with a JSON object containing the user ID who removed the vote.
DELETE /columnsRemoves a column's data
DELETE /linksRemoves a link's data
DELETE /rowsRemoves data from a row (swimlane)