[Koha-patches] [PATCH] Bug 9460 - Use DataTables on transfers to receive report page
Owen Leonard
oleonard at myacpl.org
Wed Jan 23 17:20:42 CET 2013
Replace the tablesorter plugin with the DataTables plugin on the
transfers to receive report page.
To test, open the transfers to receive report page (Circulation ->
Transfers to receive). Confirm that table sorting works correctly on
each of the tables. In this configuration there is no filtering or
pagination.
---
.../prog/en/modules/circ/transferstoreceive.tt | 29 ++++++++++----------
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/transferstoreceive.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/transferstoreceive.tt
index 6542ac3..9059f94 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/transferstoreceive.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/transferstoreceive.tt
@@ -1,23 +1,24 @@
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha › Circulation › Transfers to your library</title>
[% INCLUDE 'doc-head-close.inc' %]
-<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
-<script type="text/javascript" language="JavaScript">
+<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[
-$.tablesorter.addParser({
- id: 'articles',
- is: function(s) {return false; },
- format: function(s) { return s.toLowerCase().replace(/^(the|an|a) /,''); },
- type: 'text'
-});
+[% IF (dateformat == 'metric') %]
+dt_add_type_uk_date();
+[% END %]
$(document).ready(function() {
[% FOREACH branchesloo IN branchesloop %]
- $.tablesorter.defaults.widgets = ['zebra'];
- $("#transferst[% branchesloo.branchcode %]").tablesorter({[% IF ( dateformat_metric ) %]
- dateFormat: 'uk',[% END %]
- sortList: [[0,0]],
- headers: { 1: { sorter: 'articles' }}
- });
+ $("#transferst[% branchesloo.branchcode %]").dataTable($.extend(true, {}, dataTablesDefaults, {
+ "aoColumnDefs": [
+ { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
+ ],
+ "sDom": 't',
+ "bPaginate": false
+ }));
[% END %]
});
//]]>
--
1.7.9.5
More information about the Koha-patches
mailing list