Bugzilla – Attachment 149925 Details for
Bug 33484
Generalise table saveState for all tables
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33484: Make saveState column handling global
Bug-33484-Make-saveState-column-handling-global.patch (text/plain), 1.98 KB, created by
Martin Renvoize
on 2023-04-20 10:25:27 UTC
(
hide
)
Description:
Bug 33484: Make saveState column handling global
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2023-04-20 10:25:27 UTC
Size:
1.98 KB
patch
obsolete
>From 1644eb7b849d1a8d3f91dcb34211742568c7b710 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 11 Apr 2023 14:58:59 +0100 >Subject: [PATCH] Bug 33484: Make saveState column handling global > >This patch updates the handling for saveState added in bug 22276 to work >globally for all KohaTables that pass a table_settings hash. >--- > .../prog/en/includes/columns_settings.inc | 21 ++++++++++++++++++- > 1 file changed, 20 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc >index db3987bbdd..2419bfd5ab 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc >@@ -11,7 +11,26 @@ function KohaTable(id_selector, dt_parameters, table_settings, add_filters) { > var selector = '#' + id_selector; > > if ( table_settings ) { >- var columns_settings = table_settings['columns']; >+ >+ var table_key = >+ 'DataTables_' + >+ table_settings['module'] +'_' + >+ table_settings['page'] +'_' + >+ table_settings['table']; >+ >+ // enable stateSave >+ dt_parameters['stateSave'] = true; >+ dt_parameters['stateSaveCallback'] = function( settings, data ) { >+ localStorage.setItem( table_key, JSON.stringify(data) ) >+ } >+ dt_parameters['stateLoadCallback'] = function(settings) { >+ return JSON.parse( localStorage.getItem(table_key) ) >+ } >+ >+ // merge stateSave for column settings >+ var local_settings = localStorage.getItem(table_key); >+ var system_settings = table_settings['columns']; >+ var columns_settings = get_columns_saved_state(local_settings, system_settings); > > $(columns_settings).each( function() { > var named_id = $( 'thead th[data-colname="' + this.columnname + '"]', selector ).index( selector + ' th' ); >-- >2.40.0
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 33484
:
149444
|
149445
|
149447
|
149448
|
149449
|
149925
|
149926
|
149927
|
149928
|
149929
|
149930
|
149974
|
149975
|
149976
|
149977
|
149978
|
149979