views:

17

answers:

1

I am building a table with ajax and then attaching a jQuery tablesorter (found here). This works fine the first time. On a second time (and every one really) I empty out the rows like this:

$('#tblTableName tbody tr').empty();

I then add the rows as I did before and then reattach the tablesorter. It looks fine and I show only the rows that I just added. HOWEVER, if I sort the table it shows the rows that were emptied out (albeit sorted, <sarcasm>YAY! </sarcasm>) . I suspect that tablesorter needs to be cleared out as well, but I'm not seeing where to do that.

+1  A: 

USE

$("#YOUR TABLE ID").trigger("update");

after adding new rows

From.ME.to.YOU
Sweet. Couldn't be easier.
Anthony Potts