I render a table with theme_table()
and use tablesorting (sql) for that. It all works fine.
Except for the intial/default sort on the other tables. No user sort option defined yet. Example:
Name | Age ▼
Sort by "age" is defined in the $header
. User clicks on "Name". That now gets sorted ascending. Regardless! I need descending.
Click:
Name ▲ | Age
But I need/want:
Click:
Name ▼ | Age
Studying the code that determines the default sort order, in tablesort_header, I come across the following:
else {
// If the user clicks a different header, we want to sort ascending initially.
$ts['sort'] = 'asc';
$image = '';
}
I see no way to avoid this. Do you? Did I miss some parameter, option? I refuse to believe that Drupal makes such a silly assumption without letting developers override it.