From 6840a0d0c3dec30be77e82b7ffba63ec5f508122 Mon Sep 17 00:00:00 2001 From: 7u83 <7u83> Date: Tue, 25 Feb 2020 00:23:43 +0000 Subject: [PATCH] adding elements to the table works. but deletion is still a p[roblem --- ka.html | 23 ++++++++------------- kaform.js | 61 +++++++++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 58 insertions(+), 26 deletions(-) diff --git a/ka.html b/ka.html index 6172b49..9909594 100644 --- a/ka.html +++ b/ka.html @@ -168,22 +168,22 @@
Auslagenart | diff --git a/kaform.js b/kaform.js index 144e7c9..e46b381 100644 --- a/kaform.js +++ b/kaform.js @@ -1,15 +1,21 @@ var nextRowId=1; +function getNextRowId() { + return nextRowId; +} + function renumberTableRows(){ var row_no=1; var table = document.getElementById("tabbody"); for (var i = 0, row; row = table.rows[i]; i++) { - row.cells[0].innerHTML=row_no++; +// row.cells[0].innerHTML=row_no++; } } function deleteTableRow(rowId){ + + alert (rowId); var target = document.getElementById("upload-target"+rowId); var children = target.children; @@ -41,22 +47,33 @@ function addTableRow(){ var element = document.createElement('tr'); element.setAttribute("id", "trow"+nextRowId); + + var a_type = document.getElementById("a_type").value; + var a_date = document.getElementById("a_date").value; + var a_description = document.getElementById("a_description").value; + var a_amount = document.getElementById("a_amount").value; + var a_currency = document.getElementById("a_currency").value; + +/* a_type = "Hello";*/ + var e=""; // add column for position no - e += ''; + e += ` | ${a_type} | `; - // add coluemn for description - e += ``; + // add coluemn for a_type (Auslagenart) +// e += ` | `; + e += ` | ${a_date} | `; // add column for date - e += ``; +// e += ` | `; + e += ` | ${a_description} | `; // add column for num - e += ``; + e += ` | ${a_amount} | `; // add column for file upload - e+= ` +/* e+= `
|
- `;
+*/
+ e += `${a_currency} | `; + +// `; // add delete bnutton e += `Beleg hochladen + + + + + + + `; + document.getElementById("uploadfield").innerHTML=uf; +} $K.add('module', 'kaform', { init: function(app, context) @@ -111,7 +147,6 @@ $K.init({ }); - // startup is here @@ -125,5 +160,9 @@ $K.ajax.get({ error: function(response) {} }); +setUploadField(); + + + // add on table row //addTableRow(); |
---|