NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: charl99 on January 14, 2013, 03:59:46 AM
-
Hi,
I would like to change the color of a Browse Row to 'Green' if 2 conditions are met, eg
if (q:BrokerDone=1 and q:Status='B') then 'Green'.
This obviously gives an error. Does anybody know how I can do this?
Thanks
Charl
-
Charl,
I do this conditional row coloring a lot. More precisely, it is cell coloring for the individual cells on a row. Here is what works for me:
1. Create your color css in the custom.css file. Something as simple as:
.greenback {
color:black;
background: #A9F5A9 !important;
}
2. In your NetWebBrowse procedure, in the Inside Browse Loop / Before Table Rows embed, put your test code. I use a local variable to hold the result of the test. For example:
IF conditionA and conditionB
LOC:ColorResult = 'green'
END
3. In your NetWebBrowse settings, you set a conditional setting on the Conditional Tab for each field on the row that you want to color. For example:
Condition: LOC:ColorResult = 'green'
CSS Class: 'greenback'
You have to do that conditional test for each cell on the row that you want colored. I don't think you can color the entire row except by doing each cell on the row.
Hope that helps,
Mike Springer
-
Hi Mike,
Yes, thanks, what was I thinking???? I also do this a lot, weak moment.
You can actually change the entire row, by making l:ColorResult a Byte (and set a number to this, 1,2,3, etc and then use choose(loc:ColorResult,'Green','Red,'Gray') etc in the CSS Clasess Tab in the Browse Row field.
Thanks
Charl
-
this is the really important bit;
... in the CSS Clasess Tab in the Browse Row field.
Cheers
Bruce