Bug 10634 - Use datatables for course details items table

We should make the course items table in the course details a datatable
to enable searching or sorting.

Test Plan:
1) Apply this patch
2) View the details page for a course with items
3) Verify the table displays and is now a datatable

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This commit is contained in:
Kyle Hall 2013-07-23 12:39:03 -04:00 committed by Galen Charlton
parent 4677fa9bd2
commit 52a6d2189d

View file

@ -5,9 +5,22 @@
<title>Koha &rsaquo; Course reserves &rsaquo; Course details for [% course.course_name %]</title>
[% INCLUDE 'doc-head-close.inc' %]
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
[% INCLUDE 'datatables-strings.inc' %]
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
<script type="text/javascript">
//<![CDATA[
$(document).ready(function(){
$("#course_reserves_table").dataTable($.extend(true, {}, dataTablesDefaults, {
"sPaginationType": "four_button",
"aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]],
"iDisplayLength": 20,
"aoColumnDefs": [
{ 'bSortable': false, 'aTargets': [ 9, 10, 11 ] }
]
}));
$("a.delete_item").click(function(){
return confirm( _("Are you sure you want to remove this item from the course?"));
});
@ -56,7 +69,7 @@
</div>
[% IF course_reserves %]
<table>
<table id="course_reserves_table">
<caption>Reserves</caption>
<thead>
<tr>