jgg jgg - 3 months ago 8
jQuery Question

JQuery table sorting; problem with dynamically added rows

I am using a jquery tablesorter plugin(http://tablesorter.com/docs/) for sorting my tables. This works for rows that created already. But when I add a row dynamically with Jquery clone() method, sorting is not working.

What I should I do to sort rows even if I add a row dynamically?


$('.tablesorter').trigger('update'); after you add a row.

Tablesorter only scans through the table once, and after that it sorts on internally stored numeric or text values. It's quite clever, actually, as it makes the act of sorting super quick.