Here's how to create a conditional formatting rule via JSL. The rule displays numbers greater than 0 in red with a yellow background.
preferences(
Conditional Formatting Rules(
RuleSet(
RuleName( "Check Rule" ),
LessThan( Value( 0 ), Inclusive( 1 ), Format( TextAlpha( 0.8 ) ) ),
GreaterThan(
Value( 0 ),
Inclusive( 0 ),
Format( Text Color( "Dark Red" ), FontStyle( Bold ), Back Color(73) )
)
)
)
);
abc_list = {1.23, 0, -1, 2.844};
def_list = {35.223, 0, 1, 2};
nw = new window("Example Conditional Formatting",
panelbox("Interesting Data",
tb = tablebox(
s1 = stringcolbox("Some Text", {"AAA", "BBB", "CCC", "DDD"}),
abc_col = numbercolbox("ABC", abc_list),
def_col = numbercolbox("DEF", def_list),
),
),
abc_col << set format(4,0) << Set Conditional Format("Check Rule");
def_col << set format(4,0) << Set Conditional Format("Check Rule");
tb << Set Shade Alternate Rows( 1 )<< Set Underline Headings( 1 ) << set column borders(1);
);
Here's the output: