Bugzilla – Attachment 132830 Details for
Bug 30406
Our DT tables not filtering on the correct column if hidden by default
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30406: Add column filters before hiding columns
Bug-30406-Add-column-filters-before-hiding-columns.patch (text/plain), 2.24 KB, created by
Julian Maurice
on 2022-04-01 08:50:57 UTC
(
hide
)
Description:
Bug 30406: Add column filters before hiding columns
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2022-04-01 08:50:57 UTC
Size:
2.24 KB
patch
obsolete
>From ba43f7b32487fb91efba394f038b0b9601d626c6 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Fri, 1 Apr 2022 10:16:09 +0200 >Subject: [PATCH] Bug 30406: Add column filters before hiding columns > >The code that adds column filters works only on visible columns, so we >should hide columns after filters are created > >Test plan: >1. Apply patch >2. Go to Tables settings. Hide city_state for the cities table. >3. Create some cities and go to the cities page >4. Verify that filtering works as expected. >5. Make the city_state column appear. Verify that filtering on this > column works too >--- > koha-tmpl/intranet-tmpl/prog/js/datatables.js | 17 +++++++++-------- > 1 file changed, 9 insertions(+), 8 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >index 2d88fcdd05..7ab1def93c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >@@ -761,14 +761,6 @@ jQuery.fn.dataTable.ext.errMode = function(settings, note, message) { > > var table = $(this).dataTable(settings); > >- table.DataTable().on("column-visibility.dt", function(){ >- if( typeof columnsInit == 'function' ){ >- // This function can be created separately and used to trigger >- // an event after the DataTable has loaded AND column visibility >- // has been updated according to the table's configuration >- columnsInit(); >- } >- }).columns( hidden_ids ).visible( false ); > > if ( add_filters ) { > var table_dt = table.DataTable(); >@@ -798,6 +790,15 @@ jQuery.fn.dataTable.ext.errMode = function(settings, note, message) { > } ); > } > >+ table.DataTable().on("column-visibility.dt", function(){ >+ if( typeof columnsInit == 'function' ){ >+ // This function can be created separately and used to trigger >+ // an event after the DataTable has loaded AND column visibility >+ // has been updated according to the table's configuration >+ columnsInit(); >+ } >+ }).columns( hidden_ids ).visible( false ); >+ > return table; > }; > >-- >2.30.2
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 30406
:
132830
|
132921
|
132959