Multiple column Cell Background Color

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
Bishu
User
Posts: 429

Multiple column Cell Background Color

Post by Bishu »

I am using a Multiple column option in a list page
If the status=3 I would like show that record in green color

I try as-
if ($this->status->CurrentValue == 3) $this->RowAttrs["style"] = "background-color: #00FF00";

here the color shows on the background of the record but I color in the cell for this Multiple Option


sangnandar
User
Posts: 980

Post by sangnandar »

Use,
$this->(fieldname)->CellCssStyle = "background-color: #00FF00";


Bishu
User
Posts: 429

Post by Bishu »

sangnandar wrote:
Use,
$this->(fieldname)->CellCssStyle = "background-color: #00FF00";

As I am using the Multiple Column Option, it display the list page like
first record
Field1 Name : Value1 of First record
Field2 Name : Value2
Field3 Name : Value3

Second record
Field1 Name : Value1
Field2 Name : Value2
Field3 Name : Value3

by the code
$this->(fieldname)->CellCssStyle = "background-color: #00FF00";
it change only the Value cell
but I want to change the Field cell also.


sangnandar
User
Posts: 980

Post by sangnandar »

You can't apply "row condition" against header/footer since header/footer are applied for all rows, by using
$this->(fieldname)->HeaderCellCssClass = "yourClass";

However you can try jQuery,
$(function(
// target element that holds the value then use .val() to get value
// target header element that related to that value-element then use .css() to change color
));

Repeat above for each row using .each()


Post Reply