Tablesorter Plugin: Sort Alpha is only working in one direction
Hi,
I have a sort parser working on a table:
Table - parser for the 'Companies' column
If anyone could tell me why it only works in one direction, that would be great.
code is this:
- //table functionality
var id = -1;
// add parser through the tablesorter addParser method
$.tablesorter.addParser({
// set a unique id
id: 'companies',
is: function(s) {
// return false so this parser is not auto detected
return false;
},
format: function(s) {
var company = $('table.tablesorter tbody td#'+id).text();
id++;
return s.replace(company, id);
},
// set type, either numeric or text
type: 'numeric'
});
$('table.tablesorter > tbody tr').css('background-color', '#fff');
$('table.tablesorter').tablesorter({sortList: [[0,0]], headers:{1:{sorter:'companies'}}}).children('tbody').children('tr:even').css('background-color', '#dddcc8');
Thanks!