Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery tablesorter 2.0, resorting table after values change

I need to re-sort a table when the input elements in cells change in value. I've already created custom sorters for my data, which works wonderfully, but now I need to re-sort when data changes.

$('#id').tablesorter(...) almost does what I need, but it seems to apply ANOTHER set of sorting on a given table, which leads to really weird behavior. Is there a way to completely redo the tablesorting action, or at least for the table to resort based on new information?

From building the custom parser, I see that tablesorter builds the formatted columns and stores it internally once when the page loads, and I need to modify this behavior such that I can resort on $('#id input').change.

Any ideas? The documentation for this plugin is weak, although it is a great plugin.

like image 797
Stefan Kendall Avatar asked Aug 10 '10 20:08

Stefan Kendall


2 Answers

i think what you need to do is trigger an update.

$("#tableId").trigger("update");

that's what i'm doing to make my tables resort.

i agree with you the documentation for this plugin is weak as best.

like image 111
Patricia Avatar answered Oct 05 '22 02:10

Patricia


Are you referring to:

$("#id").trigger("update");
like image 25
Marc Avatar answered Oct 05 '22 02:10

Marc