views:

167

answers:

1

Hi All,

I have a table that has a column for Days Remaining. The values in this column are either a number, or 'TBD' (to be determined). The tablesorter plugin doesn't properly handle the sorting of this mixed-type column. How could I get this to work properly?

Thanks, ~jk

A: 

You need to create your own parser

I am not sure this will work, but try searching for tablesorter and addParser and you should be good:

jQuery.tablesorter.addParser({
  id: "SpecialNumber",
  is: function(s) {
   return /^TBD/.test(s);
  },
  format: function(s) {
   return 0;
  },
  type: "numeric"
 });
Espo