I am using afterChange and afterLoadData, but if I used setCellMeta in the hook, I can see that setCellMeta is running normally in the case of afterChange, but afterLoadData is not applied because of timing problems. If I run with setTimeout, it seems to run after everything is loaded, but how can I run the contents in the hook without using setTimeout when the table is initialized or loaded?
Below is an example of jsfiddle that corresponds to the above.
http://jsfiddle.net/csrwkt82/22/
Hi @curlydoggi
I used the callbacks
demo to test which hook runs first https://jsfiddle.net/nr3xskqb/1/
And it seems that in this case afterChange
is the one that has the ‘final word’ and should be used to call your setCellMeta()
. The before/afterChange hooks expose the source
(2nd parameter) of the change so you can use that to point loadData
as the source. Demo http://jsfiddle.net/dgyqa026/
Thank you, it was a springboard for a solution, and I would like to ask you one more question. I want to apply setCellMeta to the entire Row, is there only a way to use setCellMeta several times?
There is only a single method that applies the cell meta to a single cell. So in this case you’d need to run the loop. But luckily the setCellMeta()
itself doesn’t evoke a cell renderer so there won’t be any issues with the performance.