Bugzilla – Attachment 149447 Details for
Bug 33484
Ability to remember user's selected table configuration and search filters for 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 (ashimema)
on 2023-04-11 14:17:22 UTC
(
hide
)
Description:
Bug 33484: Make saveState column handling global
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-04-11 14:17:22 UTC
Size:
1.98 KB
patch
obsolete
>From 4aa6188e897f78b10c075d1242ac3501581617fc 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..7ff0f80d43 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
|
173443
|
173444
|
173445
|
173446
|
173447
|
173448
|
173449
|
173450
|
173451
|
173452
|
173453
|
173454
|
173455
|
173456
|
173457
|
173458
|
173459
|
173460
|
173461
|
173462
|
173463
|
173464
|
173465
|
173466
|
173467
|
173468
|
173469
|
173470
|
173471
|
173472
|
173473
|
173474
|
173475
|
173476
|
173477
|
173478
|
173479
|
173480
|
173481
|
173482
|
173483
|
173484
|
173485
|
173486
|
173546
|
173606
|
173607
|
173985
|
174219