add-card
Description
Fires when adding a new card
Usage
"add-card": ({
columnId: string | number,
id?: string | number,
rowId?: string | number,
before?: string | number,
select?: boolean,
card?: object,
skipProvider?: boolean,
}) => void;
Parameters
The callback of the add-card event can take an object with the following parameters:
columnId
- (required) the ID of the target columnid
- (optional) the ID of the new cardrowId
- (optional) the ID of the target rowbefore
- (optional) the ID of the card, before which the new card will be placedselect
- (optional) enables/disables selecting new added cardcard
- (optional) the data object of the new card. The full list of the card parameters can be found hereskipProvider
- (optional) enables/disables preventing the request from being sent to the server
info
For handling the inner events you can use the Event Bus methods
Example
// create Kanban
const board = new kanban.Kanban("#root", {
columns,
cards
});
// subscribe on the "add-card" event
board.api.on("add-card", (obj) => {
console.log(obj.columnId);
});