Bugzilla – Attachment 176147 Details for
Bug 38827
New search performed when column filters lose focus
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38827: DataTables - Do not filter when inputs lose focus
Bug-38827-DataTables---Do-not-filter-when-inputs-l.patch (text/plain), 1.58 KB, created by
Jonathan Druart
on 2025-01-06 09:52:49 UTC
(
hide
)
Description:
Bug 38827: DataTables - Do not filter when inputs lose focus
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-01-06 09:52:49 UTC
Size:
1.58 KB
patch
obsolete
>From 364af32036e532f04578e8568fa7ca530ec496b8 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 6 Jan 2025 10:48:24 +0100 >Subject: [PATCH] Bug 38827: DataTables - Do not filter when inputs lose focus > >On a table using DataTables and the REST API wrapper with the column >filters, if one input is used to filter the table the query will be made >twice: when the user stopped typing and when the input will lose the >focus. > >Test plan: >Search for patron >Open the dev console, "Network" tab >In the "Card" column filter enter "0000" >Notice that the table is filtered and that a request has been made >Click outside of the "Card" input >=> Without this patch another request (the same) is made and the table >updated >=> With this patch applied no request is made when the input loses the >focus. >--- > koha-tmpl/intranet-tmpl/prog/js/datatables.js | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >index 8b342d7cb03..aeea2f28b7c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >@@ -877,7 +877,8 @@ function _dt_add_delay_filters(table_dt, table_node) { > var i = table_dt.column.index('fromVisible', visible_i); > $(this).find("input") > .unbind() >- .bind("keyup change", function(){ >+ .bind("keyup change", function(e){ >+ if (e.keyCode === undefined) return; > col_input_search(i, this.value) > }); > >-- >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 38827
:
176147
|
176162
|
176197