-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.js
50 lines (38 loc) · 1.78 KB
/
init.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
function init(){
const app = document.getElementById("app");
let inputTable = "<table><thead><th></th><th>Mischprobe</th>";
// Überschriften
for (let index = 0; index < 12; index++){
inputTable += `<th colspan="2"><input value="true" type="checkbox" id="SampleNumber${index}" checked="true" onclick="hideText(${index})"></input>
<textarea class="MPHead" id="SampleName${index}" onclick="ausw()" style="resize:none"></textarea></th>`}
inputTable += "<th>Homogenität</th></thead>";
// Messwerte
let counter = 0;
// Select Labels Grafische Auswertung
let selectGW = ""
for (index in InitParaList){
let CurrentCategory = InitParaList[index][0].Cat;
inputTable += `<tr><td colspan="27">${parseInt(index)+1}. ${CurrentCategory}</td></tr>`;
for (q in InitParaList[index]){
let Para = InitParaList[index][q]
let PaName = Para.Name;
let Unit = Para.Unit
selectGW += `<option value="${counter}">${PaName}</option>`
inputTable += `<tr><td><input type="checkbox" id="checkbox${counter}" value="true" onclick="ausw()"></td><td>${PaName} ${Unit}</td>`;
for (let n = 0; n < 12; n++){
inputTable += `<td class="MWEingabeLabel"><input class="MWEingabe" id="Inp${PaName}${n}" type="number" min="0" onclick="ausw()"></inptut></td><td class="ErgLabel" id="Erg${PaName}${n}"></td>`
}
inputTable += `<td id="HomogenErgLabel${PaName}"> </td></tr>`;
counter += 1;
}
}
inputTable += "</table>"
document.getElementById("app").innerHTML = inputTable
document.getElementById("GO").innerHTML = selectGW
}
init()
let inputs = document.querySelectorAll("input, textarea");
for (let w = 0; w < inputs.length; w++){
let currentWidget = inputs[w];
currentWidget.addEventListener('keyup', () => ausw());
}