Dynamic Cell Class in Datagrid 2 not working properly

0
I have a datagrid 2 table and I am having a hard time figuring out how to place a condition on an attribute (decimal).  When this value under Total = $0.00 then apply specific CSS to change the BG color.  if $currentObject/Total = 0.00 then 'alert-bg-color' else '' is what I believe should work, but there is no change at all to the element, and I am not getting any errors. I have tried parseDecimal, and “toString”  Seems like this should be pretty simple but no success.    More detail: My condition of  if $currentObject/Total = 0 then 'alert-bg-color' else '' Never works. In the example below I have it set to if $currentObject/Total > 0 then 'alert-bg-color' else '' and this works but = 0 does not. I have tried < .01 as well. Its like it doesnt see the 0 as a zero value.   
asked
2 answers
1

Hi Tony,

You can use the Dynamic cell class feature on the Appearance tab

 

Here’s an example

 

 

 

In your scss class definitions

 

.below-target {

    background-color: red;

}

 

.on-target {

    background-color: greenyellow;

}

answered
0

also make sure your app settings → theme is correctly loaded with the custom css module below the datawidgets module. otherwise datawidgets might overrule your custom class

answered