Skip to content

Commit

Permalink
Merge pull request #28 from unboxed/fix-filter-on-search
Browse files Browse the repository at this point in the history
Change to only show results of selected filter - may want to relook at
  • Loading branch information
HonTastic2 authored Jul 30, 2024
2 parents d32b79a + 82a2175 commit ccccf73
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,16 +391,27 @@ function App () {
}
}


var tr = document.getElementById("applicationTable").getElementsByTagName("tr");

for (let i = 0; i < tr.length; i++) {
var td = tr[i].getElementsByTagName("td")[1];
var tdStat = tr[i].getElementsByTagName("td")[4];
if (td) {
if (toDisplay.includes(td.innerText)) {
tr[i].style.display = "";
if (document.getElementById("filterSelect").value === "None") {
if (toDisplay.includes(td.innerText)) {
tr[i].style.display = "";
}
else {
tr[i].style.display = "none";
}
}
else {
tr[i].style.display = "none";
if (toDisplay.includes(td.innerText) && document.getElementById("filterSelect").value === tdStat.innerText) {
tr[i].style.display = "";
}
else {
tr[i].style.display = "none";
}
}
}
}
Expand All @@ -412,6 +423,7 @@ function App () {
for (let i = 0; i < tr.length; i++) {
tr[i].style.display = "";
}
document.getElementById('filterSelect').selectedIndex = 0;
}

const bindSearchToEnter = () => {
Expand Down

0 comments on commit ccccf73

Please sign in to comment.