Bugzilla – Attachment 115329 Details for
Bug 27467
Provide a static URL for tables
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27467: [SOLUTION 2] Using deepLink.js
Bug-27467-SOLUTION-2-Using-deepLinkjs.patch (text/plain), 2.20 KB, created by
Jonathan Druart
on 2021-01-19 14:12:41 UTC
(
hide
)
Description:
Bug 27467: [SOLUTION 2] Using deepLink.js
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-01-19 14:12:41 UTC
Size:
2.20 KB
patch
obsolete
>From 190ad3fd95d8506b3ad4fc988d130ac4da4903e3 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 18 Jan 2021 17:24:11 +0100 >Subject: [PATCH] Bug 27467: [SOLUTION 2] Using deepLink.js > >This solution is based on > https://github.com/DataTables/Plugins/tree/master/features/deepLink > https://datatables.net/blog/2017-07-24 > >I was expecting it to let us provide the columns filters using the >following query (that would filter on name="cit"): >/cgi-bin/koha/admin/cities.pl?columns=[{"search":""},{"search":"cit"},{"search":""},{"search":""},{"search":""},{"search":""}] > >But it does not work. In my understanding this will also set the data >for each columns. As they are not in the URL, DT is using undefined >value (hence the "data is undefined" JS error) >--- > koha-tmpl/intranet-tmpl/prog/en/includes/datatables.inc | 1 + > koha-tmpl/intranet-tmpl/prog/js/datatables.js | 6 +++++- > 2 files changed, 6 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/datatables.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/datatables.inc >index a545868ce7..936985780c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/datatables.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/datatables.inc >@@ -2,4 +2,5 @@ > [% USE Asset %] > [% INCLUDE 'format_price.inc' %] > [% Asset.js("lib/datatables/datatables.min.js") | $raw %] >+[% Asset.js("lib/jquery/plugins/dataTables.deepLink.js") | $raw %] > [% Asset.js("js/datatables.js") | $raw %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >index 6baa84b8bb..9903f89514 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >@@ -741,7 +741,11 @@ jQuery.fn.dataTable.ext.errMode = function(settings, note, message) { > settings['orderCellsTop'] = true; > } > >- var table = $(this).dataTable(settings); >+ >+ var deep = $.fn.dataTable.ext.deepLink( [ >+ 'search.search', 'order', 'displayStart', 'columns' >+ ] ); >+ var table = $(this).dataTable( $.extend(settings, deep) ); > > if ( add_filters ) { > var table_dt = table.DataTable(); >-- >2.20.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 27467
:
115325
|
115326
|
115327
|
115328
|
115329
|
115330
|
115331
|
117962