Skip to content

Commit

Permalink
http module: when using initial page update, values now get updated w…
Browse files Browse the repository at this point in the history
…hen changing the page length to a higher amount of rows
  • Loading branch information
onkelandy committed Sep 18, 2023
1 parent 6339ab7 commit 581ee9c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions modules/http/webif/gstatic/datatables/datatables.defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ $(window).bind('datatables_defaults', function() {
shngGetUpdatedData(null, null, 0);
}
});
// update content on pagelength change - if activated
$(".dataTables_length").off("change").on("change", function () {
let tab = $(this).closest('.tab-pane').attr('id');
let dataTable = $(this).closest('.tab-pane').find(".dataTable").DataTable();
if (window.initial_update == 'true' && window.pageLength[tab]['pagelength'] < dataTable.page.len()){
console.log("Instant value update after length change");
shngGetUpdatedData(null, null, 0);
}
});
// Warning if first column is not empty (for responsive + sign)
td_content = $(this).find('tbody').find('td:first-child').html();
if (td_content != '' && td_content != 'No data available in table')
Expand Down

0 comments on commit 581ee9c

Please sign in to comment.