I’m having trouble with tablesorter and dynamically added rows. When I try to add my rows, I get this error:
config.parsers[j] is undefined.
I’m adding the rows the same way as in the example here, http://mottie.github.com/tablesorter/docs/example-pager.html.
delete_rows();
var html_data = '';
for ( i in wos ) {
html_data += '<tr>';
html_data += '<td><a href="#" class="get_wo" title="' + wos[i].val1 + '">' + wos[i].val1 + '</a></td>';
html_data += '<td>' + wos[i].val2 + '</td>';
html_data += '</tr>';
}
var $html_data=$(html_data);
wo.show();
$( "#wo_table" ).find('tbody').append($html_data).trigger('addRows', [$html_data]);
First I delete all the rows in my table except for the headers, then I create and append the rows to the table.
Has anyone ever had the same problem or a similar problem?
I’m using Tablesorter version 2.0.25.1
I’m not sure why you’re removing all of the table rows then using the “addRows” method, because it will just add the new rows under the original rows. So, since ALL of the rows are removed first, it would be better to use the “update” method like this (demo; click the “test” button):
Oh, and I didn’t see that error you mentioned at all.