Skip to main content

setConfig()

Description

Sets new configuration parameters of Kanban

Usage

setConfig(config: object): void;

Parameters

  • config - (required) the object of the Kanban configuration. See the full list of properties here
tip

Using this method, you can configure the Kanban widget as well as load data to it. The method changes only the parameters you passed.

important

The setConfig() method destroys the current component and initialize a new one. If you use the component with Toolbar, you need to call the setConfig() method of Toolbar, because it uses the internal API of Kanban. See the example below!

Example

// create Kanban
const board = new kanban.Kanban("#root", {
columns,
cards
});

// create Toolbar
const toolbar = new kanban.Toolbar("#toolbar", { api: board.api });

// set new configuration parameters of Kanban
board.setConfig({
editorAutoSave: false,
columnKey: "stage",
rowKey: "type",
cardShape,
editorShape,
/*other parameters*/
});

// update configuration parameters of Toolbar
toolbar.setConfig({
api: board.api
});