jQuery tablesorter with row numbers -
i using jquery tablesorter 2.0 plugin provide basic table sorting functionality.
on table, have column row number. trouble is, tablesorter plugin sorts column else. have tried setting "headers" attribute first column, removes sorting capability. not prevent column being reordered when sort different column.
is having list of row numbers possible plugin? can think of way around problem?
it sounds need renumber rows every time table sorted. try (use after have initialized tablesorter on table):
var table = $("#mytable"); table.bind("sortend",function() { var = 1; table.find("tr:gt(0)").each(function(){ $(this).find("td:eq(0)").text(i); i++; }); });
Comments
Post a Comment