How to restore to the previous position when the freeze is cancelled

Tags: #<Tag:0x00007efc61495340>

when freezing,I executed the code this.getPlugin('ManualColumnFreeze').freezeColumn(col) and render(). Unfreezethis.getPlugin('ManualColumnFreeze').unfreezeColumn(col),It did not return to its original position.If render() is not executed, the freeze will not take effect.

Hi @evan.wang

If you use the col as a physical index of a columns you will need to run toVisualColumns() method in the unfreezeColumn. Here’s a demo https://jsfiddle.net/32asft40/1/

Thank you for your quick reply. Maybe my description is not clear enough for you to misunderstand. If the third column is frozen, I hope it will return to the third column after unfreezing

Hi @evan.wang

Thank you for the details. Before Handsontable v8 that was an intended behavior that the column got back to its origin, but after the changes in v8 it no longer happens. The subject of further described in this tutorial https://handsontable.com/docs/migration-from-7.4-to-8.0/#changes-in-manualrowmove-and-manualcolumnmove-plugins-behavior at Changes in ManualColumnFreeze plugin behavior.

So to get the same behavior as in 7.4.2 you would need to manually move that column back using manualColumnMove plugin.

1 Like

Thank you again. I solved it

I’m glad to hear that. Thank you for the information.