[GH #5525] Remove_row and remove_col do not change CellMeta

Tags: #<Tag:0x00007f8b2b719658> #<Tag:0x00007f8b2b719518>

@aleksandra_budnik hi
Remove_row and remove_col do not change CellMeta, I remove some rows and add some rows.

With getCellsMeta(), get the data of the deleted rows and columns. Is this a problem?

It doesn’t make sense to me what I should do.

Hi,

Unfortunately we have a bug: https://github.com/handsontable/handsontable/issues/5525
It’s related to an Epic https://github.com/handsontable/handsontable/issues/5112 we’re currently working on.

@wojciech.czerniak
@aleksandra_budnik
thank you

However,

I use the “remove row”, “remove column” and “fetch cellsMeta” menu. They are correct.

I do this with javascript, and they don’t have the same effect as right-click menus.

By looking at the source code, I found that the right-click menu and js run functions are not the same.

The source code in the right-click menu is updated to cellsMeta, and js is not updated.

Why is that?

Or, if I’m in my js, there should be a way to trigger the remove row and remove column in the right-click menu.

ContextMenu calls alter('remove_col') how is that different from what you’re doing in JS?

Can you add jsfiddle with an example of both?

ok…thank you
@wojciech.czerniak
This is what I implemented in js

 let countRows = this.hot.countRows();   
    let countCols = this.hot.countCols();
    if (row > countRows) {
        this.hot.alter("insert_row", countRows, row - countRows);
    }
    if (row < countRows) {
        this.hot.alter("remove_row", countRows, countRows - row);
    }
    if (col > countCols) {
        this.hot.alter("insert_col", countCols, col - countCols);
    }
    if (col < countCols) {
        this.hot.alter("remove_col", countCols, countCols - col);
    }

The location of the call source is
handsontable.full.js 16993 rows。

I’m going to call remove row, remove column from the right-click menu, and they’re going to call
handsontable.full.js 17121 rows.
And more processing of cellsMeta,
See line 17139
priv. cellSettings. splice (calcIndex, amount)

My guess now is that the callback to js calls and the right-click menu calls are not the same, because I use debug mode and only the right-click menu fires.

Using js does not trigger the cellsMeta to be processed.

Am I using js incorrectly?

Thank you for sharing additional information. I have sent it to our developer.

@aleksandra_budnik
Thanks, but I have a new question.
I have a report with 1000 rows and 50 columns.
I use getCellsMeta to get all the metadata,
But from 1400 I got undefined,


Second question:
I use viewportRowRenderingOffset: 9999999, to display all of the cell, which makes my browser crashes, directly between the if there are other Settings to improve performance.

Hey @MaLaTang

the first issue looks like Wojciech wrote for this one https://github.com/handsontable/handsontable/issues/5525
I will update you as soon as it gets fixed.

When it comes to the second case. You get undefined cause the cells are not rendered yet. You’d need to call renderAllRows: true to get them, however, it decreases performance.