UI changes of update from

This commit is contained in:
2026-01-24 16:29:04 +05:30
parent 50f0e77f77
commit 30a7a4287e
11 changed files with 406 additions and 118 deletions

View File

@@ -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 = [];