I am using this great version of jQuery Tablesorter: http://mottie.github.com/tablesorter/docs/index.html
Everything is working well but now I have this problem: in
I figured it out by adding my own parser like it is shown in this question: Sorting Image and hyperlink columns in a table using JQuery Sorter plugin
I will copy my script that works as I want it to work, hope it helps someone:
$(document).ready(function() {
$.tablesorter.addParser({
// set a unique id
id: 'positions',
is: function(s) {
// return false so this parser is not auto detected
return false;
},
format: function(s) {
// format your data for normalization
return s.toLowerCase()
.replace("pg", "d")
.replace("sg", "h")
.replace("sf", "m")
.replace("pf", "r")
.replace("c", "v");
},
// set type, either numeric or text
type: 'text'
});
$(".stats").tablesorter({
sortInitialOrder: 'desc',
sortRestart: true,
headers: {
0: {
sortInitialOrder: 'asc'
},
1: {
sortInitialOrder: 'asc'
},
2: {
sorter: 'positions',
sortInitialOrder: 'asc'
}
}
}
);
});