Bug 9465 - Use DataTables on update child to adult patron page
authorOwen Leonard <oleonard@myacpl.org>
Wed, 23 Jan 2013 17:53:33 +0000 (12:53 -0500)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Fri, 15 Feb 2013 13:41:46 +0000 (08:41 -0500)
Replace the tablesorter plugin with the DataTables plugin on the
update child to adult patron page.

Added default sort by patron category description (ascending).

To test, open a patron with a child category type. Choose the 'Update
child to adult patron' item from the 'More' menu. Confirm that
table sorting works correctly in the popup.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
koha-tmpl/intranet-tmpl/prog/en/modules/members/update-child.tt

index 5d0e32f..3eb8fe5 100644 (file)
@@ -1,14 +1,20 @@
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Choose Adult category</title>
 [% INCLUDE 'doc-head-close.inc' %]
-<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
+<link rel="stylesheet" type="text/css" href="/intranet-tmpl/prog/en/css/datatables.css" />
+<script type="text/javascript" src="/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.dataTables.min.js"></script>
+[% INCLUDE 'datatables-strings.inc' %]
+<script type="text/javascript" src="/intranet-tmpl/prog/en/js/datatables.js"></script>
 <script type="text/javascript">
        $(document).ready(function() {
-               $.tablesorter.defaults.widgets = ['zebra'];
-               $("#catst").tablesorter({
-                       sortList: [[2,0]],
-                       headers: { 0: { sorter: false }}
-               });
+        $("#catst").dataTable($.extend(true, {}, dataTablesDefaults, {
+            "sDom": 't',
+            "aaSorting": [[ 2, "asc" ]],
+            "aoColumnDefs": [
+                { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false }
+            ],
+            "bPaginate": false
+        }));
        });
 </script>
 <style type="text/css">