jQuery/Tablesorter: maintain secondary alphabetical sort

Posted by user460847 on Stack Overflow See other posts from Stack Overflow or by user460847
Published on 2011-01-02T03:45:03Z Indexed on 2011/01/02 3:54 UTC
Read the original article Hit count: 149

Filed under:
|
|

I have a table of names and ages that I want the user to be able to sort. When the page initally loads, sortList lists the rows in order from oldest to youngest, and then secondarily from A to Z.

I want the same thing (a SECONDARY alphabetical sort) when the user actually clicks on the age <th>, but sortForce is making the alphabetical sort primary. Is there an alternative?

$('#super_results table').tablesorter({
    sortForce: [[0,0]],
    sortList: [[1,1],[0,0]]
});

Or am I misunderstanding sortForce? Documentation here.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery