Bug with ordering by name

Bug with ordering by name

burbur Posts: 30Questions: 2Answers: 2
edited March 8 in Free community support

When using order() to order by name in ascending direction (e.g. table.order([{ name: "position", dir: "asc" }]);), after that the first click on the header of the ordered column does nothing.

When ordering this way in descending order instead, the first click on the header of the ordered column makes it order in ascending order instead being unordered as would be expected.

Note that when ordering by name on initialization, this bug doesn't occur.

Here's a test case that demonstrates the bug: https://live.datatables.net/buxakafe/1/
The test cases uses serverSide, but the bug also occurs without it.

Replies

  • allanallan Posts: 64,230Questions: 1Answers: 10,599 Site admin

    Interesting one. Thank you for the test case and posting this. It is almost certainly something to do with the index that DataTables uses to keep track of the order sequence. I'll look into it and post back.

    Allan

  • burbur Posts: 30Questions: 2Answers: 2

    Thanks!

  • allanallan Posts: 64,230Questions: 1Answers: 10,599 Site admin

    Fix and tests committed here. It will be in the nightly shortly, and in the next release :).

    Allan

  • burbur Posts: 30Questions: 2Answers: 2

    That was fast! Thank you very much!

  • allanallan Posts: 64,230Questions: 1Answers: 10,599 Site admin

    Wish I was that fast for all of them...!

Sign In or Register to comment.