PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WEBDEV 2024 → conditionally color a column in an ajax table -- SELECTED ROW
conditionally color a column in an ajax table -- SELECTED ROW
Débuté par vvido, 29 mar. 2019 11:44 - 2 réponses
Membre enregistré
94 messages
Posté le 29 mars 2019 - 11:44
I would like to conditionally set the color of a column in a table.
For example set the color of a date (red) if it is over the due date.

I can do this for selected rows which are not selected

if <condition>
COL_Date..Color = LightRed //this is an example
end

This works correctly for NOT SELECTED rows.
I have not figured it how to set the color for selected row.

Thanks
Posté le 06 avril 2019 - 21:13
Hi vvido

//Sample of my code
IF Entity.StatementProfile = 1 THEN
TABLE_Entity[TABLE_Entity][2]..BrushColor = PastelGreen
ELSE
TABLE_Entity[TABLE_Entity][2]..BrushColor = PastelRed
END

You should try:
COL_Date..BrushColor = LightRed

Hope it helps
Membre enregistré
94 messages
Posté le 08 avril 2019 - 13:36
Thanks for the hint.

I can color the cell conditionally, but only the cells which are NOT selected.
My code is like yours, it is positioned in 'Row display of TABLE... '

When I select a row the coloring is gone. When I click on another row,
all the cells are correctly colored, EXCEPT the selected row.

Where do you put your code? did you put it in 'End of initialization of TABLE … ' ?
Or do you use Ajax calls to do it ?

Did you notice similar behavior too ?