Bugzilla – Attachment 132959 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.46 KB, created by
Jonathan Druart
on 2022-04-05 12:06:20 UTC
(
hide
)
Description:
Bug 30406: Add column filters before hiding columns
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-04-05 12:06:20 UTC
Size:
2.46 KB
patch
obsolete
>From 11202249e7112cd3211580c13faf3f3c24c1c2d2 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 >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >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 > >Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > 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 3baa6b21664..c33943df1e7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >@@ -801,14 +801,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(); >@@ -863,6 +855,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.25.1
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