Sort Column Changes On Reload When Using Reorder

Sort Column Changes On Reload When Using Reorder

dkercherdkercher Posts: 11Questions: 3Answers: 0

https://live.datatables.net/vozojago/1/edit

Steps to reproduce:
-move the far right column (Salary) to the far left (left of Name)
-sort the column to the right of it (the second column, Name) by clicking the <th>
-reload the page and see that the sort is not happening on a new column (it jumps 2 columns to the right to Office). If you moved 2 columns to the left of Name and reloaded, the sort jumps 4 columns.

It seems to trigger any time you move a column that would have been the right of a sorted column to the left of it. If you move columns that are already to the right of a sorted column (and keep them to the right of it) then the issue doesn't occur.

Any tips? I have a user story complaining about this in Production. I was going to start tackling some custom solution, but wanted to know if you all were aware and had a fix. Thanks in advance!

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin

    That's a bug. It can be seen here as well. I wasn't aware of that issue - thanks for letting me know about it. I'll post back here when I've got a fix.

    Allan

  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin

    That's a fix committed (still to write a unit test for it though, but I wanted to push the fix up before ending the day!).

    Allan

  • dkercherdkercher Posts: 11Questions: 3Answers: 0

    Thanks Allen! I'll leave the question open until it's in release, but I really appreciate you working on this so quickly!

  • dkercherdkercher Posts: 11Questions: 3Answers: 0

    Hi @allan do you know when this change will go into a release? We use the cdn or else I'd manually add the changes from your commit myself. Thanks again for addressing this!

  • dkercherdkercher Posts: 11Questions: 3Answers: 0

    Hello @allan Would you be able to add this fix to a new cdn release sometime? Thanks so much for your support!

    https://github.com/DataTables/ColReorder/commit/46aa0350ed379731e81b368be3973d6cdc27c3da

  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin
    Answer ✓

    Yes, I was hanging fire as it is the only change at the moment, but there aren't any others on the horizon, so I'll get this tagged in the next couple of days (possibly today if things go well...).

    Allan

  • dkercherdkercher Posts: 11Questions: 3Answers: 0

    Thanks, you've made one of my users extremely happy. Cheers!

Sign In or Register to comment.