The cards.list property (array) stores the Kanban card data source.
The array items are objects with the following structure:
id(number | string) - card IDname(string) - card name, displayed at the top as a header (the value is HTML-encoded automatically)text(string) - card text, displayed as the card body (the value is HTML-encoded automatically)html(string) - optional custom HTML content that overridesnameandtextcolumn(number | string) - Kanban column IDswimlane(number | string) - optional Kanban swimlane IDbarColor(string) - optional bar color override; if not specified, the columnbarColoris usedareas(array) - list of active areas
Declaration
DayPilot.Kanban.cards.listNotes
You can set this property during initialization or replace the current card collection later using kanban.update({cards}).
Examples
JavaScript
const cards = [
{id: 1, "name": "Task 1", column: "1", text: "This is a description of task #1."},
{id: 2, "name": "Task 2", column: "1", text: "This is a description of task #2.", barColor: "#ea3624"}
];
const kanban = new DayPilot.Kanban("dp", {
cards: cards,
// ...
});
kanban.init();You can also replace the current card collection after initialization:
const cards = [
{id: 1, "name": "Task 1", column: "1", text: "This is a description of task #1."},
{id: 2, "name": "Task 2", column: "1", text: "This is a description of task #2.", barColor: "#ea3624"}
];
kanban.update({cards});Angular
<daypilot-kanban [config]="config"></daypilot-kanban>config: DayPilot.KanbanConfig = {
cards: [
{ id: 1, name: "Task 1", column: "1", text: "This is a description of task #1." },
{ id: 2, name: "Task 2", column: "1", text: "This is a description of task #2.", barColor: "#ea3624" }
],
// ...
};React
const cards = [
{ id: 1, name: "Task 1", column: "1", text: "This is a description of task #1." },
{ id: 2, name: "Task 2", column: "1", text: "This is a description of task #2.", barColor: "#ea3624" }
];<DayPilotKanban
cards={cards}
{/* ... */}
/>Vue
const cards = [
{ id: 1, name: "Task 1", column: "1", text: "This is a description of task #1." },
{ id: 2, name: "Task 2", column: "1", text: "This is a description of task #2.", barColor: "#ea3624" }
];<DayPilotKanban
:cards="cards"
<!-- ... -->
/>See Also
Card Loading [doc.daypilot.org]
Angular [doc.daypilot.org]
Availability
Availability of this API item in DayPilot editions:
| Product | Lite | Pro |
|---|---|---|
| DayPilot for JavaScript |
DayPilot