Bug 13476: Fix DataTables for the search items form
authorJonathan Druart <jonathan.druart@biblibre.com>
Fri, 19 Dec 2014 09:28:47 +0000 (10:28 +0100)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Fri, 19 Dec 2014 20:21:53 +0000 (17:21 -0300)
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 <veron@veron.ch>
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
The paging seems still a bit buggy, but this makes the
feature usable again!

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/itemsearch.tt

index 0c65c11..a8a7030 100644 (file)
         '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': [