Bug 9877 - Use DataTables on funds administration page

Replace the tablesorter plugin with the DataTables plugin on the funds
administration page.

To test, open the funds administration page (Administration ->
Funds). Confirm that table sorting, paging, and searching works
correctly.

Note that the table is sorted only when hierarchical display of parent
and child funds is not enabled. When the hierarchicial display is
enabled the table sorter is not triggered.

Signed-off-by: Pierre Angot <tredok.pierre@gmail.com>

Post-QA revision adds handling for empty table: "No funds" row must have
same number of cells as the rest of the table (including hidden cell);

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
This commit is contained in:
Owen Leonard 2013-03-20 15:16:59 -04:00 committed by Jared Camins-Esakov
parent aad7490058
commit 09af6d03f5

View file

@ -136,10 +136,16 @@
//]]>
</script>
[% ELSE %]
<link href="[% themelang %]/lib/jquery/plugins/treetable/stylesheets/jquery.treeTable.css" rel="stylesheet" type="text/css" />
[% IF ( notree ) %]
<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>
[% ELSE %]
<link href="[% themelang %]/lib/jquery/plugins/treetable/stylesheets/jquery.treeTable.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/treetable/jquery.treeTable.min.js"></script>
[% END %]
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/treetable/jquery.treeTable.min.js"></script>
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.qtip.js"></script>
<script type="text/javascript">
@ -174,11 +180,14 @@
}
});
[% IF ( notree ) %]
$("#budgeth").tablesorter({
widgets : ['zebra'],
sortList: [[0,0]],
headers: { 7: { sorter: false }}
});
$("#budgeth").dataTable($.extend(true, {}, dataTablesDefaults, {
"aoColumnDefs": [
{ "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
],
"aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]],
"iDisplayLength": 20,
"sPaginationType": "four_button"
}));
[% ELSE %]
$("#budgeth").treeTable();
[% END %]
@ -296,7 +305,7 @@
</tr>
[% END %]
[% ELSE %]
<tr><td colspan="12">No fund found</td></tr>
<tr><td>No fund found</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td class="tooltipcontent">&nbsp;</td><td>&nbsp;</td></tr>
[% END %]
</tbody>
</table>