Reputation: 6680
I have java based web app. In the front end i am receiving a set of objects. One of the fields in the object is date.
Now I am trying to sort by date using . but I am not seeing the sorted result.
function update() {
var rows = $('#results tr:gt(0)');
rows.each(function(index) {
//code to show or hide rows based on some logic
}
$('#results').tablesorter({
sortList:[[8,0]]
});
}
In my 9th field is epoch time. so i am trying to sort based on that column.This column is hidden
But I am not seeing the effect.
Please help
Thanks
Upvotes: 0
Views: 104
Reputation: 86443
I'm guessing that the update function is supposed to resort the table after rows have been shown/hidden. If you want to resort the table, don't reinitialize the plugin, just trigger the sorton
method:
$("#results").trigger("sorton", [ [[8,0]] ]);
Note that there are an extra set of brackets around the sortList value, this is because the trigger method needs the parameters to be passed via an array (ref). Also check out this example.
Upvotes: 1