[Koha-patches] [PATCH] Bug 9443 - Use DataTables on MARC frameworks administration page

Owen Leonard oleonard at myacpl.org
Tue Jan 22 17:03:32 CET 2013


Replace the tablesorter plugin with the DataTables plugin on the
MARC frameworks administration page.

To test, open the MARC frameworks dministration page (Administration ->
MARC bibliographic framework -> MARC structure). Confirm that table
sorting works correctly.
---
 .../prog/en/modules/admin/marctagstructure.tt      |   20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt
index d0f0132..d1e3944 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt
@@ -5,14 +5,10 @@
 [% IF ( delete_confirmed ) %]MARC frameworks ›  Data deleted[% END %]
 [% IF ( else ) %]MARC frameworks[% END %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
-<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
-<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.pager.js"></script>
-<script type="text/javascript" id="js">$(document).ready(function() {
-	$("#table_marctagstructure").tablesorter({
-		sortList: [[0,0]],
-		headers: { 5: { sorter: false},6: { sorter: false},7: { sorter: false}}
-	}).tablesorterPager({container: $("#pagertable_marctagstructure"),positionFixed: false,size: 20});
-}); </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[
 function Check(f) {
@@ -33,6 +29,13 @@ function Check(f) {
 
 $(document).ready(function() {
     new YAHOO.widget.Button("addtag");
+    $("#table_marctagstructure").dataTable($.extend(true, {}, dataTablesDefaults, {
+        "aoColumnDefs": [
+            { "aTargets": [ -1, -2, -3 ], "bSortable": false, "bSearchable": false },
+        ],
+        "iDisplayLength": 20,
+        "sPaginationType": "four_button"
+    }));
 });
 //]]>
 </script>
@@ -158,7 +161,6 @@ $(document).ready(function() {
 </fieldset>
 </form>
 <div id="pagertable_marctagstructure">
-[% INCLUDE 'table-pager.inc' perpage='20' %]
 </div>
     <table id="table_marctagstructure">
     <thead>
-- 
1.7.9.5


More information about the Koha-patches mailing list