NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: olu on July 19, 2012, 09:47:26 PM

Title: conditional change content css on browse
Post by: olu 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.
Title: Re: conditional change content css on browse
Post by: Bruce 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


Title: Re: conditional change content css on browse
Post by: olu 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
Title: Re: conditional change content css on browse
Post by: Bruce 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')
Title: Re: conditional change content css on browse
Post by: olu 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.
Title: Re: conditional change content css on browse
Post by: Johan de Klerk 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
Title: Re: conditional change content css on browse
Post by: Bruce 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.
Title: Re: conditional change content css on browse
Post by: olu on July 20, 2012, 07:37:28 AM
Thanks bruce and johan, i have gone with bruce's idea and got it working.