add-card
Description
Triggered when a new card is added
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 for the add-card event receives an object with these properties:
columnId
- (required) the ID of the column where the card will be addedid
- (optional) the ID assigned to the new cardrowId
- (optional) the ID of the row where the card should be placedbefore
- (optional) the ID of the card that the new card will be inserted beforeselect
- (optional) determines if the newly added card should be selectedcard
- (optional) the data object representing the new card. Complete details of card parameters are available hereskipProvider
- (optional) controls whether the request to the server should be skipped
info
To manage internal events, refer to the Event Bus methods
Example
// create Kanban
const board = new kanban.Kanban("#root", {
columns,
cards
});
// listen for the "add-card" event
board.api.on("add-card", (obj) => {
console.log(obj.columnId);
});