Käyttöliittymä luokkien poistamiselle
This commit is contained in:
parent
55532c2e35
commit
c94bc35573
1 changed files with 10 additions and 1 deletions
|
@ -51,6 +51,15 @@ function vertaa(a, b) {
|
|||
function luoLuokka(id, nimi) {
|
||||
const li = document.createElement('li');
|
||||
li.id = `luokka-${id}`;
|
||||
li.textContent = nimi;
|
||||
const poistoPainike = document.createElement('input');
|
||||
poistoPainike.type = 'button';
|
||||
poistoPainike.value = '-';
|
||||
poistoPainike.addEventListener('click', () => {
|
||||
suorita(_tietokanta.transaktio((t) => {
|
||||
t.poista(taulut.luokat, id);
|
||||
}));
|
||||
});
|
||||
li.appendChild(poistoPainike);
|
||||
li.appendChild(document.createTextNode(nimi));
|
||||
return li;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue