Skip to content

Commit

Permalink
uzsu plugin: adjust webif pagelength handling to most recent approach
Browse files Browse the repository at this point in the history
  • Loading branch information
onkelandy committed Sep 16, 2023
1 parent d12cc52 commit 9aa9654
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions uzsu/webif/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,9 @@
<script>
$(document).ready( function () {
$(window).trigger('datatables_defaults');
/* get pagelength from http module or plugin. */
{% if webif_pagelength is defined %}webif_pagelength = {{ webif_pagelength|int }};{% endif %}
if (isNaN(parseFloat(webif_pagelength)) || webif_pagelength == 0) {
resize = true;
webif_pagelength = -1;
}
else {
resize = false;
}
console.log("Webif page length " + webif_pagelength + ", pageResize: " + resize);

try {
table = $('#maintable').DataTable( {
columnDefs: [{ "targets": [8], "className": "none"}].concat($.fn.dataTable.defaults.columnDefs),
pageLength: webif_pagelength,
pageResize: resize});
columnDefs: [{ "targets": [8], "className": "none"}].concat($.fn.dataTable.defaults.columnDefs)});
}
catch (e) {
console.log("Datatable JS not loaded, showing standard table without reorder option " +e);
Expand Down

0 comments on commit 9aa9654

Please sign in to comment.