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 will be placedbefore- (optional) the ID of the card before which the new card should be insertedselect- (optional) controls whether the newly added card is selectedcard- (optional) the data object representing the new card. You can find the full list of card parameters hereskipProvider- (optional) controls whether the request to the server is skipped
info
To manage internal events, you can use 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);
});