I’m using the handsontable
core library directly (MIT version) … not one of the wrappers.
In the example shown in the video Im’ seeing some redraw problems on (1) window resize, and (2) on scroll
(1) Window Resize
As you can see when the window resizes (ie. the containing div
) changes size, the table’s rendering surface is not updated, that is until I scroll it, then it redraws across the new size.
Is there a forceUpdate
or redraw
method anywhere I can call on the hot table instance? I’ve looked but can’t see anything. I’ve tried calling updateSettings
with the new instance size, eg:
const settings = { ...this.props.settings, width, height };
if (this.table) {
this.table.updateSettings(settings);
}
but this makes things worse not better. This is all I could find when I went looking for some kind or redraw method. What’s the right way to do it?
(2) Scrolling
In the video you can see me scrolling slowly and the new rows do not uniformly render. Perhaps this is related to the window-size issue above, and it does not know automatically how many row to pre-render.
I have tried setting the:
viewportRowRenderingOffset: XXX,
viewportColumnRenderingOffset: XXX,
values, but this neither seems to fix the issue - and makes performance sluggish.
Any ideas or direction? Thanks!
For reference, here is how I’m configuring that table:
import Handsontable from 'handsontable';
const data = Handsontable.helper.createSpreadsheetData(1000, 100);
const settings = {
data,
rowHeaders: true,
colHeaders: true,
colWidths: 120,
manualRowResize: true,
manualColumnResize: true,
};
this.table = new Handsontable(this.el as Element, settings);