Bug-report (1.10.x) first icon visible even if sorting is turned off
Bug-report (1.10.x) first icon visible even if sorting is turned off
see fiddle -> http://jsfiddle.net/t5sKk/
Trying to disable sorting for the first column works OK. But the sorting icon is still visible upon initialization, but disappears after the user has sorted once. This is only the case for the first column, disabling sorting on other columns does not show icons upon initialization. Also, this is only the case in 1.10.x, in 1.9.x this behaviour is not seen.
A workaround is to hide the icon manually :
table.dataTable th:first-child {
background : none;
}
check out the demo above, and run with or without the above CSS to reproduce the problem.
This question has accepted answers - jump to:
Answers
Not a bug, just an extra step needed. As the documentation for
columns.orderable
notes:So the fact that the default ordering is on the first column means that the first column is ordered by default. If you don't want that use
order
.Allan
Hi Allan!
Thank you for answering! Yes, it works with
Without using additional CSS. See fiddle -> http://jsfiddle.net/aJFzc/
NB: skipped syntax hl since it insist on showing all the code on one line.
Hi Allan Jardine,
Do I dare to suggest, to a future version, that if sorting for the first column is turned off, then the default sorting (or ordering) so will be the #2 column instead? And so on? It is somehow confusing, that sorting by default goes on 1st column, even if sorting is tuned off for this column, and an icon therefore is shown after initialization.
Not to critisize, awesome job you have done, just a suggestion.
Yup - its a good suggestion. This question is asked fairly frequently, so it probably is a good idea to change the behaviour.
Allan