I haven't looked at the code, but when I see "flatData.reverse()" I 
wonder...are you sorting the regular way and then the reverse (as in two sorts) 
even if the sortDir is initially set to sort the reverse direction?

If so, it might be nice to avoid that.

----- Original Message ----
From: Chris W. Parker <[EMAIL PROTECTED]>
To: jquery-en@googlegroups.com
Sent: Monday, April 9, 2007 2:37:42 PM
Subject: [jQuery] Re: TableSorter question


On Monday, April 09, 2007 1:40 PM Chris W. Parker <> said:

> On Monday, April 09, 2007 12:43 PM Christian Bach <> said:
> 
>> tableSorter({
>> sortColumn: 0,
>> sortDir: 1
>> });
>> 
>> Will sort the first column in the opposite direction.
> 
> Actually that just makes my arrow appear upside down.

Well I made some changes to the TableSorter file and now it works. I
just hope I didn't introduce a bug.

The original is around line 220 and reads like this:

/** if we have a sortDir, reverse the damn thing. */
if(COLUMN_LAST_DIR != COLUMN_DIR) {
    flatData.reverse();
}

I changed it to:

/** if we have a sortDir, reverse the damn thing. */
if(defaults.sortDir == 1)
{
    flatData.reverse();
}


That seems to work fine.



Chris.



Reply via email to