1

Tablesorter: sort the total score properly. Fixes #1.

This commit is contained in:
vonavi 2014-05-21 17:51:45 +03:00
parent 9ecaf82c6a
commit e86a86e4c2

View File

@ -1,6 +1,16 @@
$(function() {
/* Convert score to numeric number for sorting */
$.tablesorter.addParser({
id: 'score',
format: function(s, table, cell, cellIndex) {
return s.replace(/½/,'.5');
},
type: 'numeric'
});
/* Sort a tournament table with tablesorter */
$('.tablesorter .opponent').addClass('{sorter: false}');
$('.tablesorter th.score').data('sorter', false);
$('.tablesorter th.total').data('sorter', 'score');
$('.tablesorter').tablesorter({
theme : 'blue',
widgets : ['zebra'],