Tablesorter: sort the total score properly. Fixes #1.
This commit is contained in:
parent
9ecaf82c6a
commit
e86a86e4c2
@ -1,6 +1,16 @@
|
|||||||
$(function() {
|
$(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 */
|
/* 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({
|
$('.tablesorter').tablesorter({
|
||||||
theme : 'blue',
|
theme : 'blue',
|
||||||
widgets : ['zebra'],
|
widgets : ['zebra'],
|
||||||
|
Loading…
Reference in New Issue
Block a user