I have a problem that the sc_field_style macro does not accept variable:
I use this in the OnRecord event on Grid app:
This works, but set all records to the specified colour, as expected:
sc_field_style({task_status}, '#ff0a0a' );
This does not work:
With single quotes:
$get_col = "SELECT colour_code from tbl_task_status where ID = {task_status}";
sc_lookup(rs_col, $get_col);
$bg_col= "'" .{rs_col[0][0]}."'"; // add single quotes
echo $bg_col; //this returns the correct colour code
sc_field_style({task_status},$bg_col);
Without single quotes:
$get_col = "SELECT colour_code from tbl_task_status where ID = {task_status}";
sc_lookup(rs_col, $get_col);
$bg_col= {rs_col[0][0]}; // add single quotes
echo $bg_col; //this returns the correct colour code
sc_field_style({task_status},$bg_col);
any idea how I could change the bg color on individual rows within the grid, based on the value of the field?