I'm looking to highlight certain results in red - not based on Alternate Row styles, but based on the data contained in a column. I can highlight just the column, or the whole row.
I have an array of objects - each object has a riskLevel.
This adds the column:
$this->dtgDataGrid->AddColumn(new QDataGridColumn('Risk Level', '<?= $_ITEM->riskLevel ?>', 'HtmlEntities=false'));
This styles all <td> in this column in the “warning” style:
$this->dtgDataGrid->AddColumn(new QDataGridColumn('Risk Level', '<?= $_ITEM->riskLevel ?>', 'CssClass=warning', 'HtmlEntities=false'));
I'd want a variable CssClass - maybe something like:
$this->dtgDataGrid->AddColumn(new QDataGridColumn('Risk Level', '<?= $_ITEM->riskLevel ?>', 'CssClass= <?= fnGetClassFromRiskLevel($_ITEM->riskLevel) ?>', 'HtmlEntities=false'));
or like this:
$this->dtgDataGrid->AddColumn(new QDataGridColumn('Risk Level', '<?= $_ITEM->riskLevel ?>', 'CssClass= <?= $_ITEM->riskStyle ?>', 'HtmlEntities=false'));
Can you think of a better approach, as this doesn't seem to work?
Thanks for the advice!