NetTalk Central

Author Topic: conditionally coloring cells in a browse  (Read 3633 times)

rjolda

  • Sr. Member
  • ****
  • Posts: 329
    • View Profile
    • Email
conditionally coloring cells in a browse
« on: July 23, 2010, 11:39:42 AM »
Hi,
Trying to get my hands around the CSS and HTML and cell coloring.
I am trying to set the background to yellow on column one ( name ) if column 3 is > 0.
I defined some classes for column one and column 3 and I read the record before it is put into the browse and I set the class name for column1 and column3 depending on the value of column3. 
e.g. If col3 > 0, col1 class name = 'c1Y'
If col3 = 0, then col1 class name = 'c1N'

I created a style sheet and added it to my NetWebServer styles and it is being used as I am setting other properties and this new style sheet is being used.
I created some new classes:  .c1Y  and c1N to set the background color for column1.

In Firebug, I see the class names assigned for the cells - i.e. c1Y or c1N  but I don't see my classes .c1Y or c1N being loaded from the CSS style file for these.

Can anyone share their tricks for coloring different cells depending on a value of another field in the same line of the browse?
Are folks using "in line " HTML style to color cells?

Thanks,
Ron Jolda

Alberto

  • Hero Member
  • *****
  • Posts: 1873
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: conditionally coloring cells in a browse
« Reply #1 on: July 23, 2010, 01:54:22 PM »
Ron,
Which PR? I´m using PR25 and it works ok.
My Classes are:

.GreenBack{color: black; background: #A9F5A9;text-align: right;}
.RedBack{color: black; background: #F5A9A9;text-align: right;}

Attached you can see the image of what to add in the conditional tab.

Hope this helps
Alberto

[attachment deleted by admin]
-----------
Regards
Alberto

rjolda

  • Sr. Member
  • ****
  • Posts: 329
    • View Profile
    • Email
Re: conditionally coloring cells in a browse
« Reply #2 on: July 23, 2010, 02:10:11 PM »
I am using PR 25.
However, I was trying to set the class in code using a variable.
Thanks for the screen shots - I will try that method!
Ron

rjolda

  • Sr. Member
  • ****
  • Posts: 329
    • View Profile
    • Email
Re: conditionally coloring cells in a browse
« Reply #3 on: July 25, 2010, 07:27:08 AM »
That did the trick!
Was much easier than the way I was trying to do it!
Thank you.
Ron