Immediately after sending the above I think I realized what the problem
is.
Each of the numeric values in that first column is wrapped in <a></a>
and you're probably sorting on that. Do I need to write a parser? If so,
what might it be?


This should work:
$.tablesorter.addParser({
   id: 'genericLink',
   is: function(s) {
       var exp = /<a[^>]*">(.*)<\/a>/.test(s.toLowerCase());
       if(exp) this.type = (/<a[^>]*">(\d+)<\/a>/.test(s)) ? 'numeric' :
'text';
       return exp;
   },
   format: function(s) {
       var val = s.toLowerCase().match(/<a[^>]*">(.*)<\/a>/)[1];
       // format your data for normalization
       return (this.type == 'text') ?  $.trim(val) :
$.tablesorter.formatFloat(val);
   },
   type: 'text'
});

It works for a element with text and numeric values.

/christian

Reply via email to