[jQuery] Tablesorter + custom sort + header definitions = 'name.toLowerCase' not a function

[jQuery] Tablesorter + custom sort + header definitions = 'name.toLowerCase' not a function


Much like this guy
http://groups.google.com/group/jquery-ui/tree/browse_frm/month/2007-10/c122613777588df9?rnum=191
If i have a custom sorter defined like
$.tablesorter.addParser({
id: 'SortAccount',
is: function(s) {
return false;
},
format: function(s) {
return s; //just this for now until i get by the issue
}, // set type, either numeric or text
type: 'text'
});
If i wire up the table sorter like
$("#MyTableID").tablesorter();
all is good
but if i try
$("#MyTableID").tablesorter({
headers: {
0: { sortable: "SortAccount" },
1: { sortable: true },
etc etc
}
});
The javascript coughs a hairball and says:
name.toLowerCase is not a function
which is this line 182
if(parsers[i].id.toLowerCase() == name.toLowerCase()) {
Uggh, to hack it to get it working, i added the line:
name = '' + name;
and have
function getParserById(name) {
name = '' + name;
var l = parsers.length;
for(var i=0; i < l; i++) {
    if(parsers[i].id.toLowerCase() == name.toLowerCase()) {
        return parsers[i];
    }
}
return false;
}
and it works..... but i thought i would let the person running this
fine plugin know