Cammy Cammy - 2 years ago 145
jQuery Question

Tablesorters addparse gives "undefined is not a function "

Tablesorter isn't acception .addParser somehow. I get the error "undefined is not a function".
This is my code:

sortList: [[0,0]],
sortRestart: true,
initialized: function(table) {
var currentTable = $(table);
var startcol ="startcol");
if (startcol) {
var sorting = [[startcol, 0]];
currentTable.trigger("sorton", [sorting]);
4: { sorter: 'customparse' },
5: { sorter: 'customparse' }
id: 'customparse',
is: function (s) {
return false;
format: function (s) {
return s.replace(/\s+/g, '').replace(/,/g, '.');
type: 'numeric'

I found some other related questions and cant find my issue.. I've doubble check that jQuery isnt included twice. It works fine without addPareser even thought the jQuery version Im using is 1.11. But I tried updating to version 2.1 but no change..

Am I initiating it wrong? what am I doing wrong..

Answer Source

To add a parser, you need to use $.tablesorter.addParser(). You cannot access the method from a jQuery object, as you're trying to do.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download