NetTalk Central

Author Topic: conditional change content css on browse  (Read 5047 times)

olu

  • Sr. Member
  • ****
  • Posts: 352
    • View Profile
    • Email
conditional change content css on browse
« on: July 19, 2012, 09:47:26 PM »
Hello please can anyone help, i would like to change a browse cell content background color rater than the whole <td> color as it does at the momement when i use the browse conditional option.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11263
    • View Profile
Re: conditional change content css on browse
« Reply #1 on: July 19, 2012, 09:54:28 PM »
there are 2 CSS settings for a browse cell (actually more than 2, but 2 matter.)
One is for the "Cell" - the other is for the "Contents".

So you're free to set the background color for either, as you prefer.

cheers
Bruce



olu

  • Sr. Member
  • ****
  • Posts: 352
    • View Profile
    • Email
Re: conditional change content css on browse
« Reply #2 on: July 19, 2012, 11:01:18 PM »
hi bruce that works if i just want to change the content css to default value but i want it to change depending on a field vaule

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11263
    • View Profile
Re: conditional change content css on browse
« Reply #3 on: July 20, 2012, 02:11:31 AM »
you can put an expression in that field, using CHOOSE, or calling your own function, or whatever. So you can easily make it dependent on whatever condition you like.

For example
Choose(inv:paid=0,' Red',' Green')

olu

  • Sr. Member
  • ****
  • Posts: 352
    • View Profile
    • Email
Re: conditional change content css on browse
« Reply #4 on: July 20, 2012, 04:44:10 AM »
Hi bruce thanks for the reply i try using the Choose as advice but the only problem with using tha is that my conditions are not true ofr false but more like

gg:type = 'Single'
gg:type = 'Double'
gg:type = 'None'

And each of this will change their colour.

Johan de Klerk

  • Full Member
  • ***
  • Posts: 217
  • Johan de Klerk
    • View Profile
    • Designer Software
Re: conditional change content css on browse
« Reply #5 on: July 20, 2012, 06:34:26 AM »
You can have something like this:
Choose(gg:type = 'Single',' Red',Choose(gg:type = 'Double','Blue','Green'))

Regards

Johan de Klerk
Clarion 10, NT 11.57

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11263
    • View Profile
Re: conditional change content css on browse
« Reply #6 on: July 20, 2012, 06:38:50 AM »
or - more elegantly - just make a small source procedure that takes whatever input, and returns the name of the class to use.

olu

  • Sr. Member
  • ****
  • Posts: 352
    • View Profile
    • Email
Re: conditional change content css on browse
« Reply #7 on: July 20, 2012, 07:37:28 AM »
Thanks bruce and johan, i have gone with bruce's idea and got it working.