Bugzilla – Attachment 126673 Details for
Bug 29302
The dataTables Koha RESTful API wrapper should allow picking match type at the column level
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29302: Allow passing of 'criteria' at the column level
Bug-29302-Allow-passing-of-criteria-at-the-column-.patch (text/plain), 1.95 KB, created by
Martin Renvoize (ashimema)
on 2021-10-21 17:02:26 UTC
(
hide
)
Description:
Bug 29302: Allow passing of 'criteria' at the column level
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2021-10-21 17:02:26 UTC
Size:
1.95 KB
patch
obsolete
>From 3ac32b0390af9d2a44e88bebe22a30e07fae1757 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 21 Oct 2021 18:00:57 +0100 >Subject: [PATCH] Bug 29302: Allow passing of 'criteria' at the column level > >This patch adds the option to pass 'criteria' at the 'column' definition >level which means you can set 'contains', 'starts_with', 'ends_with' and >'exact' match types for each different column. >--- > koha-tmpl/intranet-tmpl/prog/js/datatables.js | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >index 16c4e89584..d66a3d50e9 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >@@ -578,9 +578,10 @@ jQuery.fn.dataTable.ext.errMode = function(settings, note, message) { > for (var i=0;i<attributes.length;i++){ > var part = {}; > var attr = attributes[i]; >- part[!attr.includes('.')?'me.'+attr:attr] = options.criteria === 'exact' >+ var criteria = col.criteria || options.criteria; >+ part[!attr.includes('.')?'me.'+attr:attr] = criteria === 'exact' > ? value >- : {like: (['contains', 'ends_with'].indexOf(options.criteria) !== -1?'%':'') + value + (['contains', 'starts_with'].indexOf(options.criteria) !== -1?'%':'')}; >+ : {like: (['contains', 'ends_with'].indexOf(criteria) !== -1?'%':'') + value + (['contains', 'starts_with'].indexOf(criteria) !== -1?'%':'')}; > parts.push(part); > } > return parts; >-- >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 29302
:
126673
|
127358
|
137695