Hello,
any news to the issue when formula is converted to a value if cell are merged? I found the issue described at https://github.com/handsontable/handsontable/issues/6359
but the problem remains …
Regards
Jan
Hello,
any news to the issue when formula is converted to a value if cell are merged? I found the issue described at https://github.com/handsontable/handsontable/issues/6359
but the problem remains …
Regards
Jan
Hey Jan,
when it comes to formulas we have focused on creating a plugin for the new engine. Hopefully, while creating the plugin we will avoid getting the same errors. However, it is not ready for tests yet.
Dear @aleksandra_budnik,
thank you for you quick response. I was working on workaround for this problem and the simplest way (maybe not the best) is store data then merging and then retrieve them, example:
https://jsfiddle.net/janzitniak/twL10sv9/5/
For storing (cloning) data I used:
var data_copy = JSON.parse(JSON.stringify(data));
And restoring them (after merging cells):
setInterval(function(){
hot.loadData(data_copy);
}, 200)
Notice: We can’t use hot.loadData
immediately (without setInterval
) because we don’t know how much takes merging data.
Better way should be loadData
in a callback or in afterChange
event …
EDIT: There is another issue. If I used this workaround which I described above then after applying any style (e.g. changing background color of cell) the table flashes and goes back without any formatting. Steps: Click to button Set merged cells and then to Set background color cells.
https://jsfiddle.net/janzitniak/twL10sv9/8/
Good old JSON… definitely a solid workaround. Nevertheless, I hope I will be able to update you soon with the following issue being fixed.
Thanks Alexandra, but my solution has some another problem I updated my answer above …
And now https://jsfiddle.net/handsoncode/nzq9bfyw/?
I guess that you wanted to use setTimeout
, not setInterval
so I’ve changed that. Then I just added ‘test’ instead of an empty string to test the class addition (line 53).
You are right Aleksandra, I’m not so concentrated .
I tried your example but if I made the following steps (clicking to the buttons):
Set merged cells - OK
Set background color cells - OK
then I
Set merged cells - it’s NOT OK because of cell color dissapears …
probably mergeCells
turn off cellMeta
?
The className
of cell is removed as btnMergeCells
button calls the loadData
. The data loading method removes cell meta.
Thanks Aleksandra for the explanation. Did you find any way how to keep cell meta after loading loadData
?
There is no way to do that quick and easily (a method to reload everything). But we may think about some possible approaches. To do that we need to define
My answers:
So we do not have many patterns and basically, everything is possible.
It may mean that the only way to get this done is to create a cellmeta map that can be loaded when data is merged. I would construct the map to hold an objects of {row: index, column: index, className: string}
. Cause this pattern is used by the cell
method https://handsontable.com/docs/8.2.0/Options.html#cell and you do not need to call the setCellMeta
dozen times.
I the future we are planning to add an ability to render ceratin cells, so you will only need to focus on re-rendering those cells that had a class before they were merged. However, this project hasn’t been put in a milestone yet. I’m mentioning it to give you some view on how this situation can evaluate in the future.
Thank for tip Aleksandra. Something what you mentioned I already did.
The best way how to resolve that problem should be fixing the bug with merging cells and everything will be ok
That’s true, Jan
I hope I’ll be able to share the good news sooner than later.