From 61d77134e15e88532b5a7742eb0a5dc70be51b5d Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Mon, 14 Apr 2025 22:33:57 +0000 Subject: [PATCH] Bug 39634: Correct paging number on initial load of other_holdings table To test: 1. Turn on SeparateHoldings 2. Have an item with many items at another branch, so 'Other holdings' table is large. I added 50 items to FPL. 3. Logged in as CPL go to the record in normal view. 4. Click on the 'Other holdings' tab, which should have 50+ items 5. Notice you only see the number 1 in the paging tools. 6. Click 'Next', the paging numbers correct themselves. 7. APPLY PATCH 8. Try again, this time the paging numbers should be correct initially. Signed-off-by: George Williams --- .../html_helpers/tables/items/catalogue_detail.inc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc index 5345a936b8..56145c2ede 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc @@ -288,7 +288,6 @@ otherholdings: "[% PROCESS 'build_table' tab="otherholdings" | collapse | $tojson %]", }; function build_items_table (tab_id, add_filters, dt_options, drawcallback) { - let table_dt; if ( dt_options && dt_options.hasOwnProperty('destroy') ) { // Keep a copy of the user settings, the destroy is going to trigger the column-visibility.dt event for all columns @@ -920,5 +919,13 @@ node.textContent = link_text; return node; } + + $('a[data-bs-toggle="tab"]').on('shown.bs.tab', function (e) { + const table = $(e.target).attr('href').replace('_panel' , '_table'); + const selector = $(table); + if ($.fn.DataTable.isDataTable(selector)) { + selector.DataTable().columns.adjust().draw(false); + } + }); [% END %] -- 2.39.5