A light weight PHP PDO SQLite3 KanBan Board.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
mykanban2/assets/js/view/Kanban.js

44 lines
1.1 KiB

import Column from "./Column.js";
export default class Kanban {
constructor(root) {
if (!root) {
throw new Error("Kanban root element was not found.");
}
this.root = root;
const statusSelect =
document.getElementById("task-status");
statusSelect.replaceChildren();
for (const column of Kanban.columns()) {
const columnView = new Column(
column.id,
column.title
);
this.root.appendChild(
columnView.elements.root
);
const option = document.createElement("option");
option.value = String(column.id);
option.textContent = column.title;
statusSelect.appendChild(option);
}
}
static columns() {
return [
{ id: 1, title: "Todo/Backlog" },
{ id: 2, title: "Ready" },
{ id: 3, title: "Work in Progress" },
{ id: 4, title: "QA" },
{ id: 5, title: "Completed" },
{ id: 6, title: "Archived" }
];
}
}