Skip to content

Commit

Permalink
http module: make initial page update only run once (no matter how ma…
Browse files Browse the repository at this point in the history
…ny tables are on the current page)
  • Loading branch information
onkelandy committed Sep 18, 2023
1 parent 3b955cb commit 51600cf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions modules/http/webif/gstatic/datatables/datatables.defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,11 @@ $(window).bind('datatables_defaults', function() {
if (typeof window.row_count !== 'undefined' && window.row_count !== 'false') {
setTimeout(function() { window.row_count = $.fn.dataTable.tables({ visible: true, api: true }).rows( {page:'current'} ).count(); console.log("Row count after init is " + window.row_count);}, 200);
}
console.log("Instant value update is " + window.initial_update);
if (window.initial_update == 'true') {
setTimeout(function() { shngGetUpdatedData(); }, 200);
console.log("Instant value update is " + window.initial_update + ", already run: " + window.initial_update_run);
if (window.initial_update == 'true' && window.initial_update_run == 0) {
console.log("Initializing page update on init");
window.initial_update_run = 1;
setTimeout(function() { shngGetUpdatedData(null, null, 0); }, 300);
}
//setTimeout(function() { $(window).resize(); }, 2000);

Expand Down

0 comments on commit 51600cf

Please sign in to comment.