Skip to main content

api.getState()

Description

Gets an object with the current properties of the Kanban StateStore

Usage

api.getState(): object;

Returns

The method returns an object with the following properties:

{
dragItemId: string | number,
before: string | number,
overAreaId: string | number,
overAreaMeta: object,
dropAreaItemsCoords: array,
dropAreasCoords: array,
dragItemsCoords: array,
selected: array
}

Example

// create Kanban
const board = new kanban.Kanban("#root", {
columns,
cards
});
// get the state of Kanban
const state = board.api.getState();
console.log(state);