Dear community,
I have tried to give a row another colour and it worked with this code.
oBrw:bClrStd := { || If( (cust->resstatus = "###Cancelled" .and. cust->guarancode = " "), { CLR_WHITE, CLR_RED }, { CLR_BLACK,CLR_WHITE } ) } //@IA 2020030
How can I integrate another colour for another request?
/* oBrw:bClrStd := { || If( ((cust->resstatus = "Waitlisted" .or. cust->resstatus = "Reserved" ).and. cust->guarancode = " "), ;
{ CLR_WHITE, CLR_GREEN }, { CLR_BLACK,CLR_WHITE } ) } //@IA 20200301*/
Do I have to use elseif in the oBrw:bClrStd?
If( (cust->resstatus = "###Cancelled" .and. cust->guarancode = " ") --> backgroundcolur should be red
If( ((cust->resstatus = "Waitlisted" .or. cust->resstatus = "Reserved" ).and. cust->guarancode = " ") --> backgroundcolur should be green
Thank you in advance and kind regards
Iris
xbrowse row colours
- Iris Gesser
- Posts: 38
- Joined: Fri Apr 22, 2016 10:19 pm
- Been thanked: 1 time
Re: xbrowse row colours
Iris, if the condition to set the colors is very complicated, I advise you to use a function that returns the corresponding color array
Code: Select all | Expand
oBrw:bClrStd := { || MyColors( oBrw ) }
.../...
Function MyColors( oBrw )
local aColors := { , }
If (cust->resstatus = "###Cancelled" .and. cust->guarancode = " ")
aColors := { CLR_WHITE, CLR_RED }
else
if <other condition>
aColors := { ...., ..... } etc.
else
aColors := { CLR_BLACK,CLR_WHITE }
endif
endif
.../...
Return aColors
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
- Iris Gesser
- Posts: 38
- Joined: Fri Apr 22, 2016 10:19 pm
- Been thanked: 1 time
- Iris Gesser
- Posts: 38
- Joined: Fri Apr 22, 2016 10:19 pm
- Been thanked: 1 time
Re: xbrowse row colours
Dear Iris, another way is to define the codeblock like this:
Extended literal code block.
Syntax
<| [<params,...>] | <programcode> >
Code: Select all | Expand
oBrw:bClrStd := <||
local aColors := { , }
If (cust->resstatus = "###Cancelled" .and. cust->guarancode = " ")
aColors := { CLR_WHITE, CLR_RED }
else
if <other condition>
aColors := { ...., ..... } etc.
else
aColors := { CLR_BLACK,CLR_WHITE }
endif
endif
.../...
Return aColors
>
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces