Skip to main content

API overview

Kanban constructor

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

Parameters:

  • an HTML container (the ID of the HTML container)
  • an object of the configuration parameters (check here)

Toolbar constructor

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

Parameters:

  • an HTML container (the ID of the HTML container)
  • an object of the configuration parameters (check here)

Kanban methods

NameDescription
addCard()Adds a new card into Kanban
addColumn()Adds a new column into Kanban
addComment()Adds a new comment to the specified card by its ID
addLink()Adds a new link into Kanban
addRow()Adds a new row into Kanban
deleteCard()Removes the specified card from datastore of Kanban
deleteColumn()Removes the specified column from datastore of Kanban
deleteComment()Delete a card comment by its ID
deleteLink()Removes the specified link from datastore of Kanban
deleteRow()Removes the specified row from datastore of Kanban
destructor()Removes all HTML elements of Kanban, and detaches all related events
duplicateCard()Duplicates a card by the specified ID
getAreaCards()Gets an array with data objects of all cards of the specified column (and row)
getCard()Gets a data object of the card by the specified ID
getSelection()Gets an array with ID(s) of the selected card(s)
moveCard()Moves a card to the specified column (and row)
moveColumn()Moves a column to the new position
moveRow()Moves a row to the new position
parse()Parses data into Kanban
redo()Repeats the action that was reverted by the undo action
scroll()Scrolls Kanban to the specified element
selectCard()Selects a card by the specified ID
serialize()Serializes the Kanban data to JSON
setConfig()Sets new configuration parameters of Kanban
setEdit()Toggles an editor of Kanban
setLocale()Applies a new locale to Kanban
setSearch()Looks for cards by the specified parameters
setSort()Sorts cards by the specified parameters
setTheme()Applies a new theme to Kanban dynamically (with reinitialization)
undo()Reverts the last operation in Kanban
unselectCard()Unselects card(s) by its ID
updateCard()Updates the card data by its ID
updateColumn()Updates the column data by its ID
updateComment()Update a card comment by its ID
updateRow()Updates the row data by its ID

Kanban internal API

Event Bus methods

NameDescription
api.exec()Allows triggering the inner events
api.intercept()Allows intercepting and preventing the inner events
api.on()Allows attaching a handler to the inner events
api.setNext()Allows adding some action into the Event Bus order

Export methods

NameDescription
export.json()Exports Kanban data into a JSON file

State methods

NameDescription
api.getReactiveState()Gets an object with the reactive properties of Kanban
api.getState()Gets an object with the StateStore properties of Kanban
api.getStores()Gets an object with the DataStore properties of Kanban

Kanban events

NameDescription
add-cardFires when adding a new card
add-columnFires when adding a new column
add-commentFires when adding a new comment
add-linkFires when adding a new link
add-rowFires when adding a new row
add-voteFires when a user adds a new vote
delete-cardFires when removing a card
delete-columnFires when removing a column
delete-commentFires when deleting a card comment
delete-linkFires when removing a link
delete-rowFires when removing a row
delete-voteFires when a user deletes a vote from a card
drag-cardFires when moving the card via dnd
duplicate-cardFires when duplicating a card
end-drag-cardFires when stop dragging a card
move-cardFires when moving a card
move-columnFires when moving a column
move-rowFires when moving a row
scrollFires when scrolling to the specified elements
select-cardFires when selecting a card
set-editFires when toggling an editor
set-searchFires when searching for cards
set-sortFires when sorting cards
start-drag-cardFires when start dragging a card
unselect-cardFires when unselecting a card
update-cardFires when updating card data
update-columnFires when updating column data
update-commentFires when updating a comment
update-rowFires when updating row data

Kanban properties

NameDescription
cardHeightOptional. A height of cards
cardsOptional. An array of objects containing the cards data
cardShapeOptional. An object of settings for managing the cards appearance
cardTemplateOptional. Returns and applies a new HTML template of the card
columnKeyOptional. Defines belonging the card to the column
columnsOptional. An array of objects containing the columns data
columnShapeOptional. An object of settings for managing the columns appearance
currentUserOptional. An ID of the current user
editorOptional. An object of settings for configuring the Kanban editor
editorAutoSaveDeprecated! Optional. Enables/disables an autosave mode
editorShapeOptional. An array of objects containing settings for managing the appearance and functionality of the Kanban editor
historyOptional. Enables/disables managing history
linksOptional. An array of objects containing the links data
localeOptional. An object of a custom locale of Kanban
readonlyOptional. Enables/disables editing, adding, selecting, dragging the cards
renderTypeOptional. Defines a type of cards rendering
rowKeyOptional. Defines belonging the card to the row
rowsOptional. An array of objects containing the rows (swimlanes) data
rowShapeOptional. An object of settings for managing the rows appearance
scrollTypeOptional. Defines a type of scrolling
themeOptional. A theme to be applied to Kanban

Toolbar methods

NameDescription
destructor()Removes all HTML elements of Toolbar, and detaches all related events
setConfig()Sets new configuration parameters of Toolbar
setLocale()Applies a new locale to the Toolbar of Kanban

Toolbar properties

NameDescription
apiRequired. An object with the internal API of Kanban
itemsOptional. An array with controls arranged on Toolbar of Kanban
localeOptional. An object of a custom locale of Toolbar
themeOptional. A theme to be applied to Toolbar

Common settings

NameDescription
$metaAn object of extra settings for configuring methods and events of Kanban

RestDataProvider API

RestDataProvider methods

NameDescription
getCards()Gets a promise with the cards data
getColumns()Gets a promise with the columns data
getLinks()Gets a promise with the links data
getRows()Gets a promise with the rows data
getUsers()Gets a promise with the users data
send()Sends a necessary HTTP request to the server and returns a promise with or without data depending on the request

RestDataProvider routes

NameDescription
GET /cardsGets data on all cards and returns a json object with an array of cards objects
GET /columnsGets data on all columns and returns a json object with an array of objects with columns data
GET /linksGets data on all links and returns a json object with an array of links objects
GET /rowsGets data on all rows and returns a json object with an array of objects with rows (swimlanes) data
GET /usersGets data on all users and returns a json object with an array of users objects
GET /uploadsGets the requested binary file from the server
POST /cardsCreates a new card and returns a json object with a new card ID
POST /cards/{cardId}/commentsAdds a new comment(s) to the card and returns a json object with the ID of the new added comment
POST /cards/{cardId}/voteAdds a new vote to the card and returns a json object with the voting user ID
POST /columnsAdds a new column and returns a json object with the column id
POST /linksCreates a new link and returns a json object with a new link ID
POST /rowsAdds a new row and returns a json object with the row ID in it
POST /uploadsUploads a binary file to the server and returns a json object with the file id, name, and url
PUT /cardsUpdates data on a specified card and returns an empty json object
PUT /cards/{id}/moveMoves cards to a specified position
PUT /cards/{cardId}/comments/{cardId}Updates a comment in a card and returns a json object with the ID of the updated comment
PUT /columnsUpdates data on a specified column and returns an empty json object
PUT /columns/{id}/moveMoves a column to a specified position
PUT /rowsUpdates data on a specified row (swimlane) and returns an empty json object
PUT /rows/{id}/moveMoves a row to a specified position
DELETE /cardsDeletes data on a card
DELETE /cards/{cardId}/comments/{cardId}Removes a comment from a card
DELETE /cards/{cardId}/voteRemoves a vote from a card and returns a json object with a user ID that removes a vote
DELETE /columnsDeletes data on a column
DELETE /linksDeletes data on a link
DELETE /rowsDeletes data on a row (swimlane)