Hacker table on admin dashboard can now be sorted by double clicking the headers. Spent a bit trying to implement this manually before learning about the sortable class. The more you know!

This commit is contained in:
ngolp 2024-10-27 12:28:10 -04:00
parent b65154b865
commit 228244ad2d

View file

@ -29,7 +29,7 @@
<h1 style="flex-grow:1;justify-content:center;" class="h3 mb-3 fw-normal">Registered Users</h1>
</div>
<table id="hackers" class="table table-striped">
<table id="hackers" class="table table-striped sortable">
<thead>
<tr>
<th>Options</th>
@ -107,6 +107,7 @@
<script type="text/javascript">
function filterHackers() {
//get hacker table and searchbox info
const input = document.getElementById("searchbox").value.toLowerCase();
const hackertable = document.getElementById("hackers");
let rows = hackertable.getElementsByTagName("tr");
@ -129,7 +130,6 @@
}
}
}
</script>
{% endblock %}