beforeStretchingColumnWidth Question

Tags: #<Tag:0x00007efc6479dbe8> #<Tag:0x00007efc6479d9e0>

first, im using 14.6.1 version.

I have to make the seoncd handsontable the same as the column width of the first handsontable.
but hot.getPlugin(‘autoColumnSize’).columnWidthsMap.indexedValues
and hot.getColWidth(e) return column width it not streatched width.

so i trying to use hook “beforeStretchingColumnWidth”.
but when i log that hook using console.log, there are 6 events per column, of which only the 2nd and 5th are correct value returned. the rest are all undefined.

i dont understand why it have this mechanism. cna you give me an example of using this hook?

Hi @robin

Thank you for contacting us. Handsontable is currently designed in a way that it’s based on multiple layers, which are clones of the various elements of the table. It is done to make sure that the table is rendered correctly.

I assume that the values returned by this hook are multiplied because of those layers, and some of them doesn’t have dimensions so the log returns undefined in those cases.