Bugzilla – Attachment 132921 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.38 KB, created by
Séverine Queune
on 2022-04-04 08:39:41 UTC
(
hide
)
Description:
Bug 30406: Add column filters before hiding columns
Filename:
MIME Type:
Creator:
Séverine Queune
Created:
2022-04-04 08:39:41 UTC
Size:
2.38 KB
patch
obsolete
>From cf320089d1062c9f0459a89f7ac68dc92b26f23b 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> >--- > 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 d5f100555b..60e5214375 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >@@ -793,14 +793,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(); >@@ -855,6 +847,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