NetTalk Central

Author Topic: Browse Row CSS Classes  (Read 3028 times)

charl99

  • Full Member
  • ***
  • Posts: 185
    • View Profile
    • Email
Browse Row CSS Classes
« 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

springguy

  • Full Member
  • ***
  • Posts: 195
    • View Profile
    • Email
Re: Browse Row CSS Classes
« Reply #1 on: January 14, 2013, 05:53:39 AM »
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

charl99

  • Full Member
  • ***
  • Posts: 185
    • View Profile
    • Email
Re: Browse Row CSS Classes
« Reply #2 on: January 14, 2013, 06:12:32 AM »
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

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Browse Row CSS Classes
« Reply #3 on: January 14, 2013, 07:24:18 AM »
this is the really important bit;

... in the CSS Clasess Tab in the Browse Row field.

Cheers
Bruce