jquery - How to re-init tablesorter -
i using jquery tablesorter plugin. start off having table values , initialise table so..
$("#mystorestatustbl").tablesorter({ sortlist: [[3,1],[10,0],[0,0]], stripingrowclass: ['even','odd'], striperowsonstartup: true, widthfixed: false, widgets: ['zebra'], dateformat: "uk", headers: { 0: { sorter: 'digit' }, 2: { sorter: false }, 7: { sorter: false } } }); i later wipe out contents of table after ajax call...
$('#mystorestatustbl tbody').html(''); and re-populate values after ajax call.
the re-populate working properties have applied in tablesorter init no longer applied.
i tried trigger update after ajax call...
$("#mystorestatustbl").trigger("update"); but not work. can please give me advice on this?
thanks
can please try following sequence after ajax call:
$("#mystorestatustbl").trigger("update"); var sorting = [[3,1],[10,0],[0,0]]; // sort on list $("#mystorestatustbl").trigger("sorton",[sorting]); this execute sorton event on newly populated data
Comments
Post a Comment