Try using something similar to the following:
// TableSorter
$('.reportTable').tableSorter({
        sortColumn: 'date',                             // Integer or String of 
the name of the column to
sort by.
        sortDir: 2,                                           // Change the 
default sort direction to 2
(descending)
        sortClassAsc: 'headerSortUp',           // Class name for ascending 
sorting action
to header
        sortClassDesc: 'headerSortDown',    // Class name for descending sorting
action to header
        headerClass: 'header',                      // Class name for headers 
(th's)
        stripingRowClass: ['even','odd'],        // Class names for striping 
supplyed as
a array.
        stripeRowsOnStartUp: true,              // Strip rows on tableSorter 
init.
});

Notice the sortColumn and sortDir values. sortColumn takes a value based on
the text between a <th> and </th>. sortDir is defaulted to 0, and is used in
a  trinary operator to determine the default sort direction based on 'dir %
2', which basically says take the number 'dir' divide it by 2 and if 1,
'true' is the remainder then sort ascending, otherwise sort descending.
Setting it to 2 reseults in a remainder of 0, 'false' so the default sort
direction is now descending.

I hope this helps.

-- Michael


Chris W. Parker wrote:
> 
> 
> I want my table to be sorted in the opposite direction that it's
> currently being sorted in when TableSorter does its first sort. I can't
> find a switch to do that but perhaps I'm not seeing it. Anyone know what
> it's called or should I just add my own?
> 
> 

-- 
View this message in context: 
http://www.nabble.com/TableSorter-question-tf3548948s15494.html#a10953966
Sent from the JQuery mailing list archive at Nabble.com.

Reply via email to