PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WEBDEV 2024 → conditionally color a column in an ajax table -- SELECTED ROW
conditionally color a column in an ajax table -- SELECTED ROW
Started by vvido, Mar., 29 2019 11:44 AM - 2 replies
Registered member
94 messages
Posted on March, 29 2019 - 11:44 AM
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
Posted on April, 06 2019 - 9:13 PM
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
Registered member
94 messages
Posted on April, 08 2019 - 1:36 PM
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 ?