change class using cellProperties
noninyo opened this issue · comments
Description
I would like to change the background of a cell base on his value.
I change cellProperties.className in cells function but this doesn't help.
any I idea how can I do it?
Thanks!
Demo
Hey @noninyo
here's an article full of cell dependencies example https://handsontable.com/blog/articles/2016/4/expand-your-app-with-cell-dependencies I guess that the first one fit your project well.
In this example, we use the beforeChange
hook to check the new value of a cell and attach className
(this is where you can set your background).
Hi,
Thanks for the answer!
I try using both beforeChange and afterInit but got no change
you can see it here
https://jsfiddle.net/noninyo/jv6t82gh/31/
Here's an updated demo https://jsfiddle.net/w72onxkm/
I just removed
JSFiddle have its own handling of containers and it opens the style
in the invisible area.
Thanks for the help!
It work now :)