This commit is contained in:
Николай 2023-05-19 18:58:40 +04:00
parent b48124b0b9
commit 85f38e9539
2 changed files with 0 additions and 18 deletions

View File

@ -82,22 +82,16 @@
@section Scripts
{
<script>
// get selected row
// display selected row data in text input
var table = document.getElementById("table");
var remove = document.getElementById("delete");
var done = document.getElementById("done");
var purchase = 0;
for (var i = 1; i < table.rows.length; i++) {
table.rows[i].onclick = function () {
// remove the background from the previous selected row
if (typeof index !== "undefined") {
table.rows[index].classList.toggle("selected");
}
// get the selected row index
index = this.rowIndex;
// add class selected to the row
this.classList.toggle("selected");
purchase = parseInt(this.cells[0].innerText);
remove.addEventListener("click", () => {

View File

@ -48,8 +48,6 @@
const errorP = document.getElementById("error-p");
const errorDivShell = document.getElementById("error-div-shell");
// [Event listeners]
generateButton.addEventListener("click", () => {
const dateFrom = new Date(dateFromInput.value);
const dateTo = new Date(dateToInput.value);
@ -85,10 +83,6 @@
});
});
// ![Event listeners]
// [HTML gen]
const renderTable = function (reportData) {
tbody.innerHTML = "";
reportData.forEach((record) => {
@ -134,10 +128,6 @@
return td;
}
// ![HTML gen]
// [Other]
const getDate = function (iso) {
const year = iso.substring(0, 4);
const month = iso.substring(5, 7);
@ -146,7 +136,5 @@
return date;
}
// ![Other]
</script>
}