Bugzilla – Attachment 177204 Details for
Bug 38978
[24.05.x] Can't hide column in holdings table from Table settings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38978: [24.05.x] Fix update_columns_visibility to check table settings
Bug-38978-2405x-Fix-updatecolumnsvisibility-to-che.patch (text/plain), 2.61 KB, created by
Lucas Gass (lukeg)
on 2025-01-27 21:26:17 UTC
(
hide
)
Description:
Bug 38978: [24.05.x] Fix update_columns_visibility to check table settings
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2025-01-27 21:26:17 UTC
Size:
2.61 KB
patch
obsolete
>From 3d89d2288784fafcc51cf4277047f61d6e108a68 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Mon, 27 Jan 2025 21:22:15 +0000 >Subject: [PATCH] Bug 38978: [24.05.x] Fix update_columns_visibility to check > table settings > >To test: >1. In 24.05.x, hide some columns via Table settings. >2. The columns do not hide properly, you cannot hide any columns via Table settings on this table. >3. APPLY PATCH >4. Check hiding columns now, it should work. >5. Make sure that columns with no data at all are still hidden. >6. Enable 'SeparateHoldings' and make sure you can also properly hide columns in the Other holdings table. >--- > .../tables/items/catalogue_detail.inc | 18 ++++++++++++------ > 1 file changed, 12 insertions(+), 6 deletions(-) > >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 714e60282d1..2835918271a 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 >@@ -120,10 +120,11 @@ > } > } > >- function update_columns_visibility(settings){ >- let table = settings.oInstance.api(); >- table.columns().visible(true); >- table.columns().every(function(i){ >+ function update_columns_visibility(table_dt, table_settings) { >+ table_dt.columns().visible(true); >+ const hidden_ids = _dt_visibility(table_settings, table_dt); >+ >+ table_dt.columns().every(function(i){ > let is_empty = true; > let nodes = this.nodes(); > nodes.each((td, ii) => { >@@ -132,8 +133,13 @@ > return; > } > }); >+ if (hidden_ids && Array.isArray(hidden_ids) && hidden_ids[0]) { >+ hidden_ids[0].forEach((colIndex) => { >+ table_dt.columns(colIndex).visible(false); >+ }); >+ } > if ( is_empty ) { >- table.columns(i).visible(false); >+ table_dt.columns(i).visible(false); > } > }); > } >@@ -836,7 +842,7 @@ > [% END %] > > if ( api.data().length ) { >- update_columns_visibility(settings); >+ update_columns_visibility(api, items_table_settings[tab_id]); > } > > if ( drawcallback ) { drawcallback(this); } >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 38978
:
177204
|
177205
|
177287