jquery.tablesorter.js > sorting mixed-type columns
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 tablesorte开发者_如何学Pythonr plugin doesn't properly handle the sorting of this mixed-type column. How could I get this to work properly?
Thanks, ~jk
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"
});
精彩评论