[Mode editor] Added column filtering

This commit is contained in:
Andreas
2022-08-28 19:27:24 +02:00
parent cf7d471df7
commit ba1b1402e4
2 changed files with 36 additions and 3 deletions

View File

@@ -27,8 +27,8 @@
<tr>
<th scope="col">Mode</th>
<th scope="col">Sub-Mode</th>
<th scope="col">SSB/DATA/CW</th>
<th scope="col">Active</th>
<th scope="col">SSB / DATA / CW</th>
<th scope="col">Status</th>
<th scope="col"></th>
<th scope="col"></th>
<th scope="col"></th>
@@ -58,6 +58,17 @@
<?php } ?>
</tbody>
<tfoot>
<tr>
<th scope="col"></th>
<th scope="col"></th>
<th scope="col"></th>
<th scope="col"></th>
<th scope="col"></th>
<th scope="col"></th>
<th scope="col"></th>
</tr>
</tfoot>
<table>
</div>
<br/>

View File

@@ -5,7 +5,29 @@ $('.modetable').DataTable({
"scrollY": "500px",
"scrollCollapse": true,
"paging": false,
"scrollX": true
"scrollX": true,
initComplete: function () {
this.api()
.columns()
.every(function () {
var column = this;
var select = $('<select><option value=""></option></select>')
.appendTo($(column.footer()).empty())
.on('change', function () {
var val = $.fn.dataTable.util.escapeRegex($(this).val());
column.search(val ? '^' + val + '$' : '', true, false).draw();
});
column
.data()
.unique()
.sort()
.each(function (d, j) {
select.append('<option value="' + d + '">' + d + '</option>');
});
});
},
});
function createModeDialog() {