From 6e7d8ece1fd8ee476cc9c83092cd770b0897bb58 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 5 Nov 2013 18:07:56 +0100 Subject: [PATCH] Bug 11205: fix DataTables filter issue when more than one table is on a page This patch fixes a bug where if there are more than one table on the same page that uses the DataTables column filter, applying a filter on one table applied it to both. Test plan: 1/ Go on serials/serials-search.pl?searched=1 2/ Filter on a column (e.g., title) on the open subscriptions table. 3/ Switch to the closed subscriptions table. Observe that that the table is *also* filtered by the criteria set for the open subscriptions table. 4/ Apply the patch and reload the page. 5/ This time, applying a filter on one time should not affect the other table. Signed-off-by: Brendan Gallagher Signed-off-by: Marcel de Rooy Signed-off-by: Galen Charlton --- koha-tmpl/intranet-tmpl/prog/en/js/datatables.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js index d4c161ad54..c2a2cf8720 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js @@ -115,7 +115,7 @@ jQuery.fn.dataTableExt.oApi.fnAddFilters = function ( oSettings, sClass, iDelay var table = this; this.fnSetFilteringDelay(iDelay); var filterTimerId = null; - $("input."+sClass).keyup(function(event) { + $(table).find("input."+sClass).keyup(function(event) { if (blacklist_keys.indexOf(event.keyCode) != -1) { return this; }else if ( event.keyCode == '13' ) { -- 2.39.2