From 581ee9cbf97a3c6f7b1ca36e0056dd3d2b363821 Mon Sep 17 00:00:00 2001 From: Onkel Andy Date: Tue, 19 Sep 2023 00:17:53 +0200 Subject: [PATCH] http module: when using initial page update, values now get updated when changing the page length to a higher amount of rows --- .../http/webif/gstatic/datatables/datatables.defaults.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/http/webif/gstatic/datatables/datatables.defaults.js b/modules/http/webif/gstatic/datatables/datatables.defaults.js index 10dea28a48..e10aa52772 100755 --- a/modules/http/webif/gstatic/datatables/datatables.defaults.js +++ b/modules/http/webif/gstatic/datatables/datatables.defaults.js @@ -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')