web: fix adding line to table
This commit is contained in:
parent
682e0cd9aa
commit
f8af750f02
|
@ -113,12 +113,13 @@ function select_part()
|
|||
for (const table of tables) {
|
||||
const tbody = document.getElementById(table);
|
||||
tbody.innerHTML = null;
|
||||
const content = part[table].slice();
|
||||
if ("components" == table) {
|
||||
part[table].push({name: "", quantity: ""}); // empty field to add
|
||||
content.push({name: "", quantity: ""}); // empty field to add
|
||||
} else {
|
||||
part[table].push({name: "", value: ""}); // empty field to add
|
||||
content.push({name: "", value: ""}); // empty field to add
|
||||
}
|
||||
for (const row of part[table]) {
|
||||
for (const row of content) {
|
||||
const tr = document.createElement('tr');
|
||||
let td = document.createElement('td');
|
||||
let input = document.createElement('input');
|
||||
|
|
Loading…
Reference in New Issue