olifolkerd / tabulator

Interactive Tables and Data Grids for JavaScript
http://tabulator.info
MIT License
6.71k stars 818 forks source link

moveColumn() moves the actual data/column but NOT the column header when unfreezing columns #4573

Closed Torch2401 closed 1 month ago

Torch2401 commented 1 month ago

Describe the bug

I freeze columns by updating the definition and sort/order them by moving them around. When unfreezing a column in between two frozen columns the column itself moves but the header won't. The header correctly updates again after freezing and additional column, but i have no clue on how to manually trigger that update as a work around, it seems bugged out.

Tabulator Info tabulator-tables@6.2.0

Working Example (https://jsfiddle.net/xwsp7aLr/) (edited since i put the wrong url in here the first time that didnt include data)

To Reproduce

  1. rearrange the window so that a scrollbar for the columns is needed
  2. start freezing columns using the header menu e.g. B and C
  3. unfreeze columns using the header menu again e.g. B
  4. it's bugged out even tho the column moved but not the header
  5. fix by freezing an additional column

Expected behavior The column header should move the same way as the column content and NOT be floating around weirdly as can be seen in the image

Screenshots image

Desktop (please complete the following information):

Torch2401 commented 1 month ago

Ok I was able to circumvent this, sorry for the noise, i will close the issue now. For everyone who experiences similar issues when moving and freezing manually here's the solution: You have to consider that you can only freeze columns on the right or left end, that means (at least from my testing) that you need to move the column FIRST and then UPDATE the definition to avoid weird bugs.

E.g.: When freezing, first move the column to the correct location and then freeze it (tho i think that one causes less trouble no matter how you do it), and then move or sort the other columns (if still needed)

When unfreezing move the column to the complete end of the table (as I was only freezing stuff on the left) and then unfreeze it (basically move it away from other frozen columns), you can then proceed to move it to it's right location.