Sort Column Changes On Reload When Using Reorder
Sort Column Changes On Reload When Using Reorder
![dkercher](https://secure.gravatar.com/avatar/74a3704456bf23c0b5481177632b3f2a/?default=https%3A%2F%2Fvanillicon.com%2F74a3704456bf23c0b5481177632b3f2a_200.png&rating=g&size=120)
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
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
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
Thanks Allen! I'll leave the question open until it's in release, but I really appreciate you working on this so quickly!
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!
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
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
Thanks, you've made one of my users extremely happy. Cheers!