Hi,
I have been using conditional_css and I came across a challenge.
I have one hidden date column that is used to compare today's date:
SELECT due_date, (due_date,'%Y%m%d') as due_date_grid FROM…
I want to set the column background green if is due or red if overdue.
I can set the background column on the hidden column using the following lines:
$f = array();
$f["column"] = "due_date_grid";
$f["op"] = ">=";
$f["value"] = date("Ymd");
$f["cellcss"] = "'background-color':'#aae4a7', 'color':'black'";
$f_conditions[] = $f;
But I want to set the color on the "normal" due date column, not the hidden one. Because the hidden one shows as yymmdd and my due date column is the display one: dd/mn/yyyy.
If I do that:
$f = array();
$f["column"] = "due_date_grid";
$f["op"] = ">=";
$f["value"] = date("Ymd");
$f["css"] = "'background-color':'#aae4a7', 'color':'black'";
$f_conditions[] = $f;
It sets the background for the whole row, I don't want that.
Any ideias?
Many thanks.
You can also have extended conditional formatting using JS code.
Refer faq: How to apply formatting of rows, based on 2 or more fields. http://phpgrid.org/faqs
I've also emailed you a demo grid code
I've verified on Firefox 43.0.1, that demo cell formatting works as expected.
(I can't run your emailed demo coz of missing database)
In any case, you might need to hack css using debugger and override the conflicting style.