Search code examples
jquerytablesorter

jQuery Tablesorter first sort click descending


So I know you can set the default sort order of specific columns with tablesorter. This is a bit different.

If you click any non-sorted column, the first sort is always ^ (asc). I want the first click to be V (desc).

Any idea what this option would be in the API? I can't seem to find it.


Solution

  • Looks like a dup.

    <script type="text/javascript">
        $(document).ready(function() 
        { 
          $("#theTable").tablesorter({ 
            sortInitialOrder: 'desc',
            sortList: [[3,1]] // etc.
    
           }); 
        } 
        ); 
    </script>
    

    How to get jQuery Tablesorter to sort descending by default?