ce icon indicating copy to clipboard operation
ce copied to clipboard

UpdateTable re-running for all cells after any cell value changes/updates

Open thelightbringer opened this issue 6 years ago • 2 comments

Hi Paul,

I can see that updateTable method is running for all the cells in the table, even if any of the cell value is updated. Is there a way to stop this ? For larger tables, iterating through all the cells would be a big performance overhead. Is there a way I can limit this to only initialization and not update?

Thanks in advance

thelightbringer avatar Dec 11 '19 10:12 thelightbringer

You can use onchange and not use updateTable.

pphod avatar Dec 11 '19 12:12 pphod

Actually I wanted to style every cell based upon some of the properties present in it's row. For that I have used updateTable. This method has all the params needed to serve my changes. For eg.,

updateTable: function(instance, cell, col, row, val, label, cellName) { // I want to style few cells based upon the values // present in their adjacent cells (same row) },

This works perfectly fine and I'm able to add those classes. The only problem I face is when I try to update the value present in any of the cell manually, this updateTable cycle runs again for every cell. I can always check for the presence of classes before adding them. But I'm wondering whether there is some call back once the the updateTable cycle completes for every cell for the first time itself.

thelightbringer avatar Dec 12 '19 04:12 thelightbringer