How to change the color of a field according to a condition?
Is it possible ?
Yes = green
NO = RED
How to change the color of a field according to a condition?
Re: How to change the color of a field according to a condition?
Do you mean in tableview (TV) or in detailview (DV)?
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: How to change the color of a field according to a condition?
Tableview:
https://bigprof.com/appgini/tips-and-tu ... eview-data
https://forums.appgini.com/phpbb/viewtopic.php?t=2894
Detailview:
Results:
Beware
If there is only little text (like in the screenshots), you will not be able to see that much difference. Additionally, 8% of all men have some kind of color-blindness, most of them have red-green-color-blindness.
Regards,
Jan
https://bigprof.com/appgini/tips-and-tu ... eview-data
https://forums.appgini.com/phpbb/viewtopic.php?t=2894
Detailview:
- Create a file named hooks/TABLENAME-dv.js
- Put the following code there:
- Save the file
- Test
Code: Select all
$j(function(){
var condition = true; // replace the value by your calculated result
var color = condition ? 'green' : 'red';
var fieldname = "id";
$j('#'+fieldname).css('color', color);
});
Beware
If there is only little text (like in the screenshots), you will not be able to see that much difference. Additionally, 8% of all men have some kind of color-blindness, most of them have red-green-color-blindness.
Regards,
Jan
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools