Sort change lines with same values
Sort change lines with same values

Link to test case: https://jsfiddle.net/4oybwm18/
Debugger code (debug.datatables.net):
Error messages shown: none
Description of problem:
I have a table with 2 columns and 2 lines.
The 2 lines have the same value in the first column.
When i sort the first column in asc, it doesn't change anaything but when i sort in desc, it changes the order of the lines.
It was not like that in previous version 1.10.*, it didn't change anything in asc or desc.
Is it possible to change this behavior?
Thanks
This question has accepted answers - jump to:
Answers
This note explains the behavior change. Also see this thread.
Kevin
I think the new behavior is a good think.
I just don't understand why an order desc change the order of the data.
The values are the same, so why is there an order applied?
Mike
With DataTables 2 it resets the ordering to the original index order on each order action, as described in the links Kevin gave. That allows the ordering to always be deterministic from that first state. But more than that, for a descending sort will with reverse the original order. Which is what you are seeing here.
That reverse can be disabled using
orderDescReverse
which has a fuller description and example.Allan
I've just spotted that page as an error - escaped HTML. I've got a fix which I'll deploy soon
.
Allan
thank you,
the option orderDescReverse is just what i was looking for.
(i don't know why i haven't seen it before...)
Mike
378 options listed here. Missing one is a forgeable offence
.
Allan