Bugzilla – Attachment 177241 Details for
Bug 26553
Remove KohaTable (columns_settings.inc) and use kohaTable (datatables.js)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26553: Bring default columnDefs back
Bug-26553-Bring-default-columnDefs-back.patch (text/plain), 2.62 KB, created by
Jonathan Druart
on 2025-01-28 09:43:11 UTC
(
hide
)
Description:
Bug 26553: Bring default columnDefs back
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-01-28 09:43:11 UTC
Size:
2.62 KB
patch
obsolete
>From 13225ec43afd6234605ece60b666d74af2bac411 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 28 Jan 2025 10:33:19 +0100 >Subject: [PATCH] Bug 26553: Bring default columnDefs back > >--- > koha-tmpl/intranet-tmpl/prog/js/datatables.js | 11 +++++++++++ > koha-tmpl/opac-tmpl/bootstrap/js/datatables.js | 11 ++++++++--- > 2 files changed, 19 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >index 0a489f31a3a..a49e1d30f2d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >@@ -1091,6 +1091,17 @@ function _dt_save_restore_state(table_settings, external_filter_nodes={}){ > } > } > >+ var default_column_defs = [ >+ { "targets": ["string-sort"], "type": "string" }, >+ { "targets": ["anti-the"], "type": "anti-the" }, >+ { "targets": ["NoSort"], "orderable": false, "searchable": false } >+ ]; >+ if (settings["columnDefs"] === undefined) { >+ settings["columnDefs"] = default_column_defs; >+ } else { >+ settings["columnDefs"] = settings["columnDefs"].concat(default_column_defs); >+ } >+ > $(this).data('bKohaColumnsUseNames', settings.bKohaColumnsUseNames); > $(this).data('bKohaAjaxSVC', settings.bKohaAjaxSVC); // Must not be used for new tables! > var table = $(this).dataTable(settings); >diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/datatables.js b/koha-tmpl/opac-tmpl/bootstrap/js/datatables.js >index 1c786951a00..c4d270ff153 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/js/datatables.js >+++ b/koha-tmpl/opac-tmpl/bootstrap/js/datatables.js >@@ -311,10 +311,15 @@ function _dt_visibility(table_settings, table_dt){ > } > > var default_column_defs = [ >- { "aTargets": ["string-sort"], "sType": "string" }, >- { "aTargets": ["anti-the"], "sType": "anti-the" }, >- { "aTargets": ["NoSort"], "bSortable": false, "bSearchable": false } >+ { "targets": ["string-sort"], "type": "string" }, >+ { "targets": ["anti-the"], "type": "anti-the" }, >+ { "targets": ["NoSort"], "orderable": false, "searchable": false } > ]; >+ if (settings["columnDefs"] === undefined) { >+ settings["columnDefs"] = default_column_defs; >+ } else { >+ settings["columnDefs"] = settings["columnDefs"].concat(default_column_defs); >+ } > > $(this).data('bKohaColumnsUseNames', settings.bKohaColumnsUseNames); > var table = $(this).dataTable(settings); >-- >2.34.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 26553
:
175186
|
175187
|
175188
|
175189
|
175190
|
175191
|
175874
|
175875
|
175876
|
175877
|
175878
|
175879
|
176359
|
176360
|
176361
|
176362
|
176363
|
176364
|
176588
|
176589
|
176590
|
176591
|
177087
|
177088
|
177089
|
177090
|
177091
|
177092
|
177152
|
177153
|
177154
|
177155
|
177156
|
177157
|
177158
|
177234
|
177235
|
177236
|
177237
|
177238
|
177239
|
177240
|
177241
|
177242
|
177243
|
177246
|
177247
|
177264
|
177265
|
177271
|
177888
|
177889
|
177890
|
177891
|
177892
|
177893
|
177894
|
177895
|
177896
|
177897
|
177898
|
177899
|
177900
|
178508
|
178509
|
178510
|
178511
|
178512
|
178513
|
178514
|
178515
|
178516
|
178517
|
178518
|
178519
|
178520
|
178521
|
178522
|
178523
|
178524
|
178525
|
178526
|
178527
|
178528
|
178529
|
178530
|
178531
|
178532
|
178533