I am trying to change the background color of a cell on a list page based on its value. Possible values are between 1 and 5 so I have a table that has these values with corresponding hex color code to apply to the cells with that value.
Then I am trying to apply the color on the List page: After Record Processed event:
$color = "#FF0000";//DB::DBLookup("select BackColor from appraisal_ranking WHERE RankName = '".$data["Ranking"]."'");
$colorcode = "'"."background-color:".$color."'";
$record["Ranking_css"].=$colorcode;
It does not work. When I hard code the color like this
$record["Ranking_css"].='background-color:#FF0000';
it works. But as the color of each value can be set by the user from another page, I need to lookup the color, not hard code it.
Finally when I echo $colorcode, I get the correct value: 'background-color:#FF0000'
What am I missing?