- $.tablesorter.defaults.widgets = ['zebra'];
- [% IF ( dateformat == 'metric' ) %]$.tablesorter.defaults.dateFormat = ['uk'];[% END %]
- $("#holdst").tablesorter({
- sortList: [[0,0]]
- });
- $("#checkoutst").tablesorter({
- [% IF ( JacketImages ) %]sortList: [[2,0]][% ELSE %]sortList: [[1,0]][% END %]
- });
- $("#overduest").tablesorter();
+
+ var dTables = $("#checkoutst,#holdst,#overduest");
+ dTables.each(function(){
+ var thIndex = $(this).find("th.psort").index();
+ $(this).dataTable($.extend(true, {}, dataTablesDefaults, {
+ "aaSorting" : [[ thIndex, 'asc' ]],
+ "aoColumnDefs": [
+ { "aTargets": [ "nosort" ],"bSortable": false,"bSearchable": false },
+ { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
+ { "sType": "title-string", "aTargets" : [ "title-string" ] }
+ ]
+ }));
+ });
+