UI changes of update from
This commit is contained in:
@@ -1,11 +1,6 @@
|
||||
/* =====================================================
|
||||
GLOBAL STATE
|
||||
===================================================== */
|
||||
let addedYears = [];
|
||||
|
||||
/* =====================================================
|
||||
INITIALIZE YEARS FROM DATABASE HEADERS
|
||||
===================================================== */
|
||||
// INITIALIZE YEARS FROM DATABASE HEADERS
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
const headers = document.querySelectorAll("#tableHeader th");
|
||||
|
||||
@@ -19,9 +14,8 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||
});
|
||||
});
|
||||
|
||||
/* =====================================================
|
||||
ADD YEAR COLUMN (DYNAMIC)
|
||||
===================================================== */
|
||||
|
||||
// ADD YEAR COLUMN (DYNAMIC)
|
||||
function addYearColumn() {
|
||||
const yearSelect = document.getElementById("yearSelect");
|
||||
const year = yearSelect.value;
|
||||
@@ -54,9 +48,8 @@ function addYearColumn() {
|
||||
});
|
||||
}
|
||||
|
||||
/* =====================================================
|
||||
ADD NEW ROW
|
||||
===================================================== */
|
||||
|
||||
// ADD NEW ROW
|
||||
function addRow() {
|
||||
const tbody = document.querySelector("#matTable tbody");
|
||||
const tr = document.createElement("tr");
|
||||
@@ -79,9 +72,8 @@ function addRow() {
|
||||
tbody.appendChild(tr);
|
||||
}
|
||||
|
||||
/* =====================================================
|
||||
SAVE SINGLE ROW
|
||||
===================================================== */
|
||||
|
||||
// SAVE SINGLE ROW
|
||||
function saveRow(btn) {
|
||||
const tr = btn.closest("tr");
|
||||
const inputs = tr.querySelectorAll("input");
|
||||
@@ -128,9 +120,8 @@ function saveRow(btn) {
|
||||
});
|
||||
}
|
||||
|
||||
/* =====================================================
|
||||
SAVE ALL ROWS
|
||||
===================================================== */
|
||||
|
||||
// SAVE ALL ROWS
|
||||
function saveAll() {
|
||||
let rows = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user