Hi Flexmonster team
I am currently working on an issue where we only mark regular data-cells after a certain "state" they are in.
So if the value for given cell is changed we change the state of that cell.
The way we get that reference is from:
const cell: HTMLDivElement = _.last(this.container.querySelectorAll(div[data-r='${row}'][data-c='${column}']
));
The issue is that when I try to do so with subtotals and grandtotals it returns undefined and therefore we can't set a state on them.
Do you have any idea how to query on them?
sincerely
Line / Accobat
Hello,
Thank you for reaching out to us.
The behavior you are describing is expected when retrieving a cell element reference via querySelector
. Flexmonster uses the virtual grid to optimize the rendering process, which means that the cells are dynamically created and destroyed on scroll, so that only the visible part of the grid is rendered instead of all cells.
To reliably apply custom logic or styles to cells, we recommend using the customizeCell
API call, which allows for triggering a callback function every time a cell is rendered, ensuring that changes are applied consistently.
Please let us know if our recommendation helped you.
Best regards,
Maksym