fnSort from separate link, have to click twice on column header
fnSort from separate link, have to click twice on column header
RichinMN
Posts: 2Questions: 0Answers: 0
Looking for a workaround to the following issue - maybe it is a code problem on my part...
My stripped-down example here: http://live.datatables.net/ujiduk
You can toggle the sorting back and forth using separate links which call fnSort, the sorting also toggles back and forth using the column headers - however - if you sort using the links until a column is ascending, then click on the column header, nothing happens (until the second click, at which point it goes descending).
So to reproduce, load my example at the link above, click "Sort Col B" which sorts Col B ascending, and then click on the "Col B" column header, which should reverse the sort... nothing happens.
Inspecting the changes that occur in the html on the columnheader when you call fnSort, you can see that the "class" changes from "sorting_asc" to "sorting_desc", something called "aria-sort" changes from "ascending" to "descending", however the "aria-label" does not change (it always reads "...activate to sort column ascending").
I am hoping there is a workaround for this where I can watch an event, force a refresh, or maybe toggle a value that isn't being toggled somewhere, or maybe I missed something in my sort code.
Thanks!
-Rich
My stripped-down example here: http://live.datatables.net/ujiduk
You can toggle the sorting back and forth using separate links which call fnSort, the sorting also toggles back and forth using the column headers - however - if you sort using the links until a column is ascending, then click on the column header, nothing happens (until the second click, at which point it goes descending).
So to reproduce, load my example at the link above, click "Sort Col B" which sorts Col B ascending, and then click on the "Col B" column header, which should reverse the sort... nothing happens.
Inspecting the changes that occur in the html on the columnheader when you call fnSort, you can see that the "class" changes from "sorting_asc" to "sorting_desc", something called "aria-sort" changes from "ascending" to "descending", however the "aria-label" does not change (it always reads "...activate to sort column ascending").
I am hoping there is a workaround for this where I can watch an event, force a refresh, or maybe toggle a value that isn't being toggled somewhere, or maybe I missed something in my sort code.
Thanks!
-Rich
This discussion has been closed.
Replies
The good news is that I've reworked this in DataTables 1.10 (which is currently pre-beta) so that problem no longer exists (or rather, DataTables is a bit more smart about it): http://live.datatables.net/ujiduk/3/edit .
Allan