Cells in cells function call for every cell in the table

Tags: #<Tag:0x00007f8b2572bac0>

Hello,

Our company is user of commercial license of your product.
And we are facing many problems we successfully solved before.
Still I want to mention very huge problem for us with upgrading from very old version to the latest one:

cells function

cells function
Defines the cell properties for given row, col, prop coordinates. Any constructor or column option may be
overwritten for a particular cell (row/column combination) using the cells property in the Handsontable constructor.

We were expecting from start it calls only visible cells. But it’s not! It’s calling all cells which present in datasource.
And this is the only entry point where you could make cells readOnly. And it’s calling our internal functions multiple times for the whole range not for only visible cells. You could find sample, it fails with 7.0 and it fails with 6.2 etc.

https://jsfiddle.net/9ps1g7um/1/

Not all of them. First it calls only cells that are visible. Later it calls one for each column, because we need to getCellMeta().

Can you add more details what you want to do and why? Maybe we can figure something out.

Did you get a chance to check my link?
You could find there it’s calling all 1000 columns on start and each render. I have on screen only 3 cols visible.
And it’s doing this twice.

I had to write my own function on the top of it and check is cell inside of the visible area, and only at this case call data for this cell.

You’re right @mojpo4tovik

by default, all the columns in the example are loaded. I have mentioned this subject here https://github.com/handsontable/handsontable/issues/5204

When it comes to the method that you use. Can you sare a bit more information (when it should run, which range of cells)?

I had to write my own function on the top of it and check is cell inside of the visible area, and only at this case call data for this cell.

it is currently the only approach - limiting the calls by adding additional conditions

Thank you for the answer.
Yes, the problem that we have around 20K+ rows and 20K+ columns. Some of them are calculating on “fly” because of totals data calculation is really complex in our project. We had a problem that HT was asking data for all 20K totals, this was killing up until I figured out that cells are working different (before we used ancient version of HT from 2013-2014 year or something) and after I updated our core to new version it slowed down in thousand time.

But checking active visible area helped.

I am happy to hear that you have found a way to make it better.

Also, I highly encourage you to follow this subject https://github.com/handsontable/handsontable/issues/5769