this.renderersPortalManager is null after inserting row on table

Tags: #<Tag:0x00007efc5e3e6640> #<Tag:0x00007efc5e3e64d8>

I am currently setting up a number of interdependent tables for a feature at the company I work at. One of these features is a webpage where there are 5 Handsontable’s rendered that all talk to each other independently.

Whenever I add a new row to table3, table2, or table4 (all referenced by table5) I receive an error that this.renderersPortalManager is null. If I comment table5 out, I am able to successfully add rows at will to any table.

I am using Hyperformula and they are all combined together under the same instance so I can retrieve the values as needed (see image below for how I am using formulas, table names sanitized)

image

Any help would be greatly appreciated!

Hi @mstorey

Thank you for contacting us. It will be very hard to tell anything more without seeing the code. Would it be possible for you to create a minified code example representing the issue?

Hey @adrian.szymanski.

I created a sanitized version and found my issue. The issue was relating to storing changed rows to update on the backend. Storing them in state caused a re-render and crash.

I did, however, find another issue wherein adding new rows is not updating my formulas. If I add rows to the upper most row or the bottom most row, the formulas do not recalculate. If any rows are added to the inner most rows, the inserts work fine.

Here is a link to the code sandbox.

EDIT
Here is an image to explain where the issue is. Adding rows in the green direction from the topmost/bottom most row work fine. Adding them in the red direction (replacing where the first row is or the last row is) causes the formulas to not recalculate.

Hi @mstorey

Thank you for the demo. The issue you are encountering is due to not updating the formula range after adding new rows. You will need to modify the range with each new row added. You can use our hooks to do this: https://handsontable.com/docs/javascript-data-grid/api/hooks/#aftercreaterow

Hi @adrian.szymanski

Thanks for the explanation. For further clarification, do you mean I’ll need to manually re-calculate the formula per-row insert, or is there a hook/function I can use to automatically achieve this? In the demo, I already use the afterCreateRow hook to modify the added row to default values within the row to 0 and add a sum formula. If there is another intended way to use the hook I might have missed it.

Hi @mstorey

Yes, that’s correct. At the moment it’s the only available way to get the proper results after adding the rows that are outside pre-defined range.