-
Notifications
You must be signed in to change notification settings - Fork 96
default sort on page load ignores direction #30
Copy link
Copy link
Open
Description
A descent sorting on page load seems impossible because of the check for a different column.
The sort function with direction 'desc' still sorts the column in ascending order:
$('table.sortable').tablesort().data('tablesort').sort($("th.default-sort"), 'desc');
Changing the following line fixed that issue for me:
https://github.com/kylefox/jquery-tablesort/blob/master/jquery.tablesort.js#L42
from if (this.index !== th.index()) {
to if (this.index !== null && this.index !== th.index()) {
Reactions are currently unavailable