Input types of tc edit modified

This commit is contained in:
Kai Lauterbach 2023-05-05 11:07:56 +02:00
parent 840443e46e
commit 402b63d680
2 changed files with 32 additions and 20 deletions

View file

@ -230,11 +230,14 @@ table.appendChild(headerRow);
for (var row = 0; row < 10; row++) { for (var row = 0; row < 10; row++) {
var contentRow = document.createElement("tr"); var contentRow = document.createElement("tr");
var hourCell = document.createElement("td"); var hourCell = document.createElement("td");
var hourInput = document.createElement("input"); var hourSelect = document.createElement("select");
hourInput.type = "number"; for (var hour = 0; hour <= 23; hour++) {
hourInput.min = 0; var option = document.createElement("option");
hourInput.max = 23; option.value = hour;
hourCell.appendChild(hourInput); option.text = hour.toString().padStart(2, "0");
hourSelect.appendChild(option);
}
hourCell.appendChild(hourSelect);
contentRow.appendChild(hourCell); contentRow.appendChild(hourCell);
var minuteCell = document.createElement("td"); var minuteCell = document.createElement("td");
var minuteSelect = document.createElement("select"); var minuteSelect = document.createElement("select");
@ -248,11 +251,14 @@ minuteCell.appendChild(minuteSelect);
contentRow.appendChild(minuteCell); contentRow.appendChild(minuteCell);
for (var channel = 1; channel <= 4; channel++) { for (var channel = 1; channel <= 4; channel++) {
var channelCell = document.createElement("td"); var channelCell = document.createElement("td");
var channelInput = document.createElement("input"); var channelSelect = document.createElement("select");
channelInput.type = "number"; for (var i = 0; i <= 100; i++) {
channelInput.min = 0; var option = document.createElement("option");
channelInput.max = 100; option.value = i;
channelCell.appendChild(channelInput); option.text = i.toString();
channelSelect.appendChild(option);
}
channelCell.appendChild(channelSelect);
contentRow.appendChild(channelCell); contentRow.appendChild(channelCell);
} }
table.appendChild(contentRow); table.appendChild(contentRow);

View file

@ -279,11 +279,14 @@ function createTable() {
// Spalte "Stunde" // Spalte "Stunde"
var hourCell = document.createElement("td"); var hourCell = document.createElement("td");
var hourInput = document.createElement("input"); var hourSelect = document.createElement("select");
hourInput.type = "number"; for (var hour = 0; hour <= 23; hour++) {
hourInput.min = 0; var option = document.createElement("option");
hourInput.max = 23; option.value = hour;
hourCell.appendChild(hourInput); option.text = hour.toString().padStart(2, "0");
hourSelect.appendChild(option);
}
hourCell.appendChild(hourSelect);
contentRow.appendChild(hourCell); contentRow.appendChild(hourCell);
// Spalte "Minute" // Spalte "Minute"
@ -301,11 +304,14 @@ function createTable() {
// Spalten "ch1" bis "ch4" // Spalten "ch1" bis "ch4"
for (var channel = 1; channel <= 4; channel++) { for (var channel = 1; channel <= 4; channel++) {
var channelCell = document.createElement("td"); var channelCell = document.createElement("td");
var channelInput = document.createElement("input"); var channelSelect = document.createElement("select");
channelInput.type = "number"; for (var i = 0; i <= 100; i++) {
channelInput.min = 0; var option = document.createElement("option");
channelInput.max = 100; option.value = i;
channelCell.appendChild(channelInput); option.text = i.toString();
channelSelect.appendChild(option);
}
channelCell.appendChild(channelSelect);
contentRow.appendChild(channelCell); contentRow.appendChild(channelCell);
} }