[Koha-patches] [PATCH] Bug 9449 - Use Datatables on staff client cart

Owen Leonard oleonard at myacpl.org
Tue Jan 22 20:43:48 CET 2013


Replace the tablesorter plugin with the DataTables plugin in the
staff client cart.

To test, add multiple items to the Cart in the staff client. View the
cart and confirm that table sorting works correctly. In this
configuration there should be no pager and no results filtering.
---
 .../intranet-tmpl/prog/en/modules/basket/basket.tt |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt
index 9989194..e23ba90 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt
@@ -10,7 +10,10 @@
 </style>
     [% ELSE %][% INCLUDE 'doc-head-close.inc' %]
 	<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
-	<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">
 	//<![CDATA[
 
@@ -65,9 +68,14 @@ function placeHold () {
         $(".hold").text(_("Place Hold"));
         $("#downloadcartc").empty();
         yuiToolbar();
-        $("#itemst").tablesorter({
-            headers: { 0: { sorter: false }}
-        });
+        $("#itemst").dataTable($.extend(true, {}, dataTablesDefaults, {
+            "sDom": 't',
+            "aoColumnDefs": [
+                { "aTargets": [ 0,3 ], "bSortable": false, "bSearchable": false },
+            ],
+            "aaSorting": [[ 1, "asc" ]],
+            "bPaginate": false
+        }));
 	});
 
 function yuiToolbar() {
-- 
1.7.9.5


More information about the Koha-patches mailing list