Skip to content

Commit

Permalink
Merge pull request #134 from gavsto/dev
Browse files Browse the repository at this point in the history
ENHANCEMENT: Filtering for Users
  • Loading branch information
gavsto authored Oct 27, 2021
2 parents 3ed1f46 + 4cfbd5b commit d42328d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
26 changes: 26 additions & 0 deletions js/datatables/datatablesusers.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,26 @@ $(document).ready(function () {
if (TenantID !== '') {
$('.datatable-1').dataTable(
{
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>')
});
});
},
language: {
paginate: {
next: '<i class="fas fa-arrow-right"></i>',
Expand Down Expand Up @@ -54,6 +74,12 @@ $(document).ready(function () {
}
}
],
'columnDefs': [
{
"targets": [2, 3, 4, 5], // your case first column
"className": "text-center align-middle"
}
],
"order": [[0, "asc"]],
}
);
Expand Down
2 changes: 1 addition & 1 deletion version_latest.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.7
1.1.8

0 comments on commit d42328d

Please sign in to comment.