I want to create functionality for remembering column widths in localStorage
When I move a column, I use the onColumnResizeEnd method in which, in addition to the current column, I want to get the current width data of the remaining visible columns, but I get the previous width values
I also used gantt.getGridColumn(‘name’) and gantt.config.columns the result is the same
If you add setTimeout with a delay of 0 the values will be correct but I don’t like this solution
const handleColumnResizeEnd = () => {
const storedColumnsWidth = getPreferencesItemByKey(projectId, StorageKey.ColumnsWidth)
setTimeout(() => {
if (storedColumnsWidth) {
gantt.getGridColumns().forEach(item => {
storedColumnsWidth[item.name] = item.width
})
storePreferences(projectId, StorageKey.ColumnsWidth, storedColumnsWidth)
}
}, 0)
}