Change Coloured Cells Depending on Value

buc

New Member
Hi, I can not figure out how to change color to a cell depending on the choice dropdown element fabrik, I tried so but nothing

In Use as row class di fabrik element i entered mialista but the result does not change


$element = $this->_row->data['richiesta___stato'];
if ($element == In elaborazione) {echo ".mialista {background-color: #FF0000;}";}
elseif ($element == Alla firma) {echo ".mialista {background-color: #FF9900;}";}
elseif ($element == Firmato) {echo ".mialista {background-color: #339900;}";}
echo "

help me please :(
 
1. Your code is wrong, must be
if ($element == "In elaborazione")

2. Not sure what you are trying to do where. If you set "use as row class" (it's just a yes/no, nothing to enter) you'll get a list view with HTML code
<tr class="element_value1" ...
<tr class="element_value2" ...
and you can set your CSS in custom_css.php
.element_value1 {background-color: #FF0000;}
 
Thanks for the answer, and I apologize if I was not clear enough.
I want to change color to a table cell, depending on the choice dropdwon made in data entry.

eg.
if I choose the "The signing" I wish that the cell color is yellow
if I choose the "Signed" want to appear red.

how can I do?

I set the custom_css, but I do not understand from your answer where to insert the code html

<tr class = "element_value1" ...
<tr class = "element_value2" ...

please can you help me.:(
Thanks.
 
Great I managed to do it but not quite
I put in the class cell
tr class = "Signed" td class = "signature"
in custom_css.php
.Firmato .richiesta Was ___
{
background-color: green;
color: black;
}
.At the signature was .richiesta ___
{
background-color: yellow;
color: black;
}
for "signed" works
no signature

I tried to write it so well in custom.css

.alla_firma .richiesta was ___
{
background-color: yellow;
color: black;
}

and
tr class = "Signed" td class = "alla_firma"

but wrong.

please help me last effort:(

thanks
 
Last issue ....
how do I get the color of the whole column?
so I just get the color on the first cell of the column
if I insert other data I colored only the last inserted.

thanks
 
I discovered inserting other data that I color the cells so
alternate

How can I fix?
 

Attachments

  • ima.gif
    ima.gif
    47.7 KB · Views: 403
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top