Button Colvis and ColReorder problem
Button Colvis and ColReorder problem

I am trying to integrate ColReorder with my current Datatables, which is the following one: https://datatables.net/download/#bs/jszip-2.5.0/dt-1.10.18/b-1.5.6/b-colvis-1.5.6/b-html5-1.5.6/b-print-1.5.6/cr-1.5.0/fh-3.1.4/r-2.2.2/sl-1.3.0
When I reorder a column the Colvis button (and the API itself) does not contain the correct order of the columns afterwards. And this happens when there is a hidden column in between.
For example, this is the initial state of the columns and Button Colvis:
Here I move the first column 2 positions, without any hidden columns in between:
As it can be seen Colvis is still calculating the positions correctly. However when I move the column past a hidden column (right to the Zip column) the following happens:
And this is also having implications in the filtering requests.
Thank you in advance for the help.
Answers
Hi @tsunamo ,
We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin
Hello @colin and thank you for the information. I have prepared a demo here:
http://live.datatables.net/wayeboti/1
If you hide the Office and Age columns and move the Name column to the right of the Position column, colvis displays the information correctly.
However when moving the Name column to the last column colvis does not show the order correctly.
Thank you again and sorry for the inconvenience.
Your demo isn't showing any problem for me. ColVis is working as expected.
I'm using Chrome, but I don't see how this could be browser-specific.
Hi @tsunamo ,
Thanks for that, I'm seeing the problem. @tangerine, if you hide Office and Age, move Name to the end of the columns, and press the button again, you'll see Name isn't in the expected place in the list.
There were a few other issue discussing compatibility issues, but they should have been resolved in the release last week. I'll raise this in our system and will report back when it progresses.
Apologies for the inconvenience,
Cheers,
Colin
My apologies, you're right. I don't know how I missed that.
Hello again @colin ,
Was this raised on the system?. I created a demo with the nightly versions of Datatables and this is still a problem. http://live.datatables.net/pirubegu/1/edit
Thank you,
Alvaro
Hi @tsunamo ,
It was (DD-836 for my reference), it hasn't been looked at due to other priorities. We'll report back here if it is progressed.
Cheers,
Colin
Hello @colin ,
Great! Appreciate your quick response!
Alvaro
We will be releasing today, and this fix will be present.
Cheers,
Colin
Hi @colin ,
Thank you for the fix and for letting me know.
Have a nice day,
Alvaro