colors in view list column

vaguemind

Vaguemind
I have a check box element which has values ( seller, Buyer ) and i need when the value seller be selected show it in list view in green color . but if value buyer selected so it appears in list view in blue color ?
 
Have you looked at the "use as row class" setting on the element's List Settings?

This will add the value of that element as a class for that row in the list. So in your case, 'seller' (or whatever) would be added as a class.

You can then use a custom CSS file to define styles for rows depending on the element values. So copy the custom_css_example.php from the default list template as custom_css.php into whatever list template you are using, and replace the actual sample CSS in that example with something like this:

Code:
#listform_$c tr.seller {
        background: #00ff00;
}

#listform_$c tr.buyer {
        background: #0000ff;
}

-- hugh
 
Have you looked at the "use as row class" setting on the element's List Settings?

This will add the value of that element as a class for that row in the list. So in your case, 'seller' (or whatever) would be added as a class.

You can then use a custom CSS file to define styles for rows depending on the element values. So copy the custom_css_example.php from the default list template as custom_css.php into whatever list template you are using, and replace the actual sample CSS in that example with something like this:

Code:
#listform_$c tr.seller {
        background: #00ff00;
}
 
#listform_$c tr.buyer {
        background: #0000ff;
}

-- hugh
Sorry ,
i do the same things but can get the results like you said. ( i use list template div). What is the clue.!Tx
 
It does not work with the "div" template because it is.. a div, not a table. The CSS rules are applied to the <tr> tag of the table, which are not present in your template.
Using Firebug, you should be able to identify the class or id on which you can apply a CSS rule to achieve the expected result.
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top