selected all

This commit is contained in:
Valentin CZERYBA 2023-10-31 17:26:30 +01:00
parent 6b752e9b2f
commit 98779d67c4
2 changed files with 10 additions and 1 deletions

View File

@ -170,7 +170,7 @@
</thead>
<tbody>
<tr>
<td><input type="checkbox" class="checkboxList" aria-label="Checkbox for following text input"></td>
<td><input type="checkbox" class="checkboxList" userid="" aria-label="Checkbox for following text input"></td>
<td></td>
<td></td>
<td></td>

View File

@ -96,6 +96,7 @@ instance.get("users", {withCredentials: true, params:param}).then(function(respo
}
var trAll = document.querySelectorAll("#users tbody tr")
td = trAll[i].querySelectorAll("td");
td[0].querySelector("input").setAttribute("userid", listData[i].id)
td[1].textContent = listData[i].id;
td[2].textContent = listData[i].username;
td[3].textContent = listData[i].email;
@ -129,6 +130,14 @@ instance.get("users", {withCredentials: true, params:param}).then(function(respo
});
}
document.getElementById("checkboxPrincipal").addEventListener("click", function(e){
listCheck = document.getElementsByClassName("checkboxList");
var checkPrincipal = e.currentTarget.checked;
for (var i=0; i<listCheck.length; i++){
listCheck[i].checked = checkPrincipal;
}
});
});