I need to change the color of certain elements in the grid, depending on a condition. One situation is that I need to keep track of dates that are expired. How can I do that?
[EDITED]
You can use the onEachRow event for the grid, and replace the value for the element with a DIV using it to change background/foregroud or other properties:
(versionInstalada - versionVigente - nombreSoftware: columns names from my sample grid)
function dbgrid_1_onEachRow($app, &$row)
{
// Change cell background based on condition
if ($row->versionInstalada < $row->versionVigente) {
$row->nombreSoftware = '< div style="background:#FFE2B8;color:>#E51C23">'.$row->nombreSoftware.'< /div>';
}
}
Hope this helps
Please note that I inserted an extra space in the opening and closing DIV tags, because the forum was interpreting it as part of the HTML of the page.
So for the code to work in your app, just remove the extra space in "< div" and "< /div>".
Regards
Revisiting this issue I noted that your last response is not shown complete... can you repost the sample, please? Thank you vey much...
Apologies, it goes like this
< P class="text-primary"> $row->columnName </ P >
Apologies, it goes like this
< P class="text-primary"> $row->columnName < / P >