Running setCellContents in HyperFormula doesn't update HandsonTable as expected

Tags: #<Tag:0x00007f51c1beb620> #<Tag:0x00007f51c1beb120>

I’ve made a simple example on stackblitz:

TLDR; running setCellContents on HyperFormula doesn’t affect the linked HandsonTable unless we run .render() on the table. There’s nothing in the documentation of either noting this behaviour. I figured out the render workaround as I noticed the values applied after resizing my browser. Dumb luck for me.

This Forum thread, and GitHub issue makes me think this is a regression bug? Or maybe it just needs better documentation?


Hi @david

Thank you for contacting us. This is actually a correct behavior. Most of the Handsontable’s hooks also fire the render() method additionally to update the view. HyperFormula doesn’t incorporate similar solution as it is also meant to work with other libraries. So basically while using HyperFormula methods to update the data the Handsontable’s render() method also needs to be added.

Thanks Adrian,

I thought that might be the case, but was put-off by this in the docs:

Calling this method manually is not recommended. Handsontable tries to render itself by choosing the most optimal moments in its lifecycle.
~ https://handsontable.com/docs/javascript-data-grid/api/core/#render

@david

I can understand that. This description could be better but in the essence it means that it is called internally when needed, so doing it twice is not recommended.