设置表格字段背景色displayOption
public void displayOption(Common _record, FormRowDisplayOption _options)
{
GridColours gridColoursLocal = _record;
;
super(_record, _options);
// If highlight flag is set, then give the entire row a black background/white text
if (gridColoursLocal.Highlight)
{
_options.backColor(WinApi::RGB2int(255,255,0)); // Yellow
}
else
{
if (gridColoursLocal.RequestedDate < systemDateGet() || gridColoursLocal.ConfirmedDate > gridColoursLocal.RequestedDate)
{
_options.backColor(WinApi::RGB2int(255,0,0)); // Red
_options.textColor(WinApi::RGB2int(255,255,255)); // White text
if (gridColoursLocal.RequestedDate < systemDateGet())
{
// Applies only to the RequestedDate field on the grid
_options.affectedElementsByControl(Grid_RequestedDate.id());
}
if (gridColoursLocal.ConfirmedDate > gridColoursLocal.RequestedDate)
{
// Applies only to the RequestedDate field on the grid
_options.affectedElementsByControl(Grid_ConfirmedDate.id());
}
}
}
}