跳至主要内容

getAreaCards()

描述​

获取指定列(和行)中所有卡片的数据对象数组

用法​

getAreaCards(
columnId: string | number,
rowId?: string | number
): array;

参数​

  • columnId - (必需)目标列的 ID
  • rowId - (可选)目标行的 ID

返回值​

该方法返回包含卡片数据对象的数组

信息

如果 Kanban 仅包含 列 而没有 行,则只需传入 columnId 参数。此时,方法返回包含指定列中所有卡片数据对象的数组。

如果 Kanban 包含 列 和 行,则可以同时传入 columnId 和 rowId 参数。此时,方法返回包含特定列和行中所有卡片数据对象的数组。

示例​

// 创建 Kanban
const board = new kanban.Kanban("#root", {
columns,
cards,
rows
});
// 获取指定列和行的卡片数据对象数组
board.getAreaCards("column_id", "row_id");