This commit is contained in:
parent
e8c3da4ac8
commit
c30052bac7
@ -9,26 +9,28 @@ function init() {
|
|||||||
.then((books) => {
|
.then((books) => {
|
||||||
// prepare response
|
// prepare response
|
||||||
books.forEach(apiResponseParsing);
|
books.forEach(apiResponseParsing);
|
||||||
document
|
document.getElementById("search").addEventListener("input", (e) => {
|
||||||
.getElementById("search")
|
|
||||||
.addEventListener("input", triggerUpdate);
|
|
||||||
document
|
|
||||||
.getElementById("childrens")
|
|
||||||
.addEventListener("change", triggerUpdate);
|
|
||||||
renderTable(
|
renderTable(
|
||||||
search(books, "", document.getElementById("childrens").checked)
|
search(
|
||||||
|
books,
|
||||||
|
e.target.value,
|
||||||
|
document.getElementById("childrens").checked
|
||||||
|
)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
document.getElementById("childrens").addEventListener("change", (e) => {
|
||||||
|
|
||||||
function triggerUpdate() {
|
|
||||||
renderTable(
|
renderTable(
|
||||||
search(
|
search(
|
||||||
books,
|
books,
|
||||||
document.getElementById("search").value,
|
document.getElementById("search").value,
|
||||||
document.getElementById("childrens").checked
|
e.target.checked
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
});
|
||||||
|
renderTable(
|
||||||
|
search(books, "", document.getElementById("childrens").checked)
|
||||||
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderTable(books, sortField) {
|
function renderTable(books, sortField) {
|
||||||
|
Loading…
Reference in New Issue
Block a user