From 2ca3276ae8becd6194e772deb009f15e3e4b635e Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 19 Dec 2014 10:28:47 +0100 Subject: [PATCH] [Signed-off] Bug 13476: Fix DataTables for the search items form MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This items form is broken since the upgrade to DataTables 1.10.2 (commit 954c2874d0d9ebfa2e910dcd4445010115fac329). The fnServerParams does not work anymore. Test plan: Go on catalogue/itemsearch.pl, launch a search and verify the data are correctly displayed in the table. Followed test plan. Works as expected. Signed-off-by: Marc VĂ©ron --- .../intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt index 0c65c11..a8a7030 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt @@ -215,11 +215,20 @@ 'bServerSide': true, 'bProcessing': true, 'sAjaxSource': '/cgi-bin/koha/catalogue/itemsearch.pl', - 'fnServerParams': function(aoData) { + 'fnServerData': function(sSource, aoData, fnCallback) { aoData.push( { 'name': 'format', 'value': 'json' } ); for (i in params) { aoData.push(params[i]); } + $.ajax({ + 'dataType': 'json', + 'type': 'POST', + 'url': sSource, + 'data': aoData, + 'success': function(json){ + fnCallback(json); + } + }); }, 'sDom': '<"top pager"ilp>t<"bottom pager"ip>r', 'aoColumns': [ -- 1.7.10.4