add datatables savestate feature

This commit is contained in:
Ariel Rin
2021-11-27 23:02:33 +10:00
parent 8b8dcc0127
commit dfe62db8ee
7 changed files with 23 additions and 4 deletions

View File

@@ -193,6 +193,8 @@
"columnDefs": [
{ "sortable": false, "targets": [1] },
],
"stateSave": true,
"stateDuration": 0
});
$('#table-members').DataTable({
"columnDefs": [
@@ -200,6 +202,8 @@
{ "sortable": false, "targets": [0, 2] },
],
"order": [[ 1, "asc" ]],
"stateSave": true,
"stateDuration": 0
});
$('#table-unregistered').DataTable({
"columnDefs": [
@@ -207,6 +211,8 @@
{ "sortable": false, "targets": [0, 2] },
],
"order": [[ 1, "asc" ]],
"stateSave": true,
"stateDuration": 0
});
});

View File

@@ -43,6 +43,9 @@
{% endblock %}
{% block extra_script %}
$(document).ready(function(){
$('#table-search').DataTable();
$('#table-search').DataTable({
"stateSave": true,
"stateDuration": 0
});
});
{% endblock %}