Quantcast
Channel: DataTables 1.9 — DataTables forums
Viewing all articles
Browse latest Browse all 124

Show data is sorted when not sorted by dataTables

$
0
0

The data for my table is pre-sorted so I don't want the overhead of dataTables doing the first sort. I have set aaSorting to [] so that dataTables does not sort the data.

My problem is that I would like the header style to show which column the data is sorted by and when that column is sorted for it to toggle the sort order.

I tried a cheat of the following which displays the way I want but I have to click twice to change the search to descending.

    dataTableOptions.fnInitComplete = function (oSettings, json) {
        $table.find('th:first').addClass('sorting_asc');
    };

Any suggestions would be greatly appreciated.

Thanks.


Viewing all articles
Browse latest Browse all 124

Trending Articles