Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Custom Coloring for Badge List

Keegan_WApr 2 2018 — edited Apr 2 2018

Hi,

I have a requirement to show a count of unanswered requests in a badge list which drills down to the details of the count diplayed. This is no problem - I've done this with a Classic Report with Appearance > Template set to badge list:

badge list no color.JPG

But the additional requirements is to color them based on some logic (green if 0, yellow if between 1-2, red if 3+)

So I found this thread: https://community.oracle.com/thread/4106293

And implemented this JavaScript code in a Dynamic Action (Where Event = After Refresh):

$(".t-BadgeList-value").each(function()

                         {           

                            if (parseInt($(this).text()) \< 1) 

                            { 

                                $(this).css({"background-color":"green"}); 

                                $(this).css({"border":"green"}); 

                                $(this).css({"color":"white"}); 

                            } 

                            if (parseInt($(this).text()) >= 1 && parseInt($(this).text()) \< 3) 

                            { 

                                $(this).css({"background-color":"orange"}); 

                                $(this).css({"border":"orange"}); 

                                $(this).css({"color":"white"}); 

                            } 

                            if (parseInt($(this).text()) >= 3) 

                            { 

                                $(this).css({"background-color":"red"}); 

                                $(this).css({"border":"red"}); 

                                $(this).css({"color":"white"}); 

                            } 

                         });

And it seems to be working well for the background colors but I want to change the border color to match the background and the text color to white for better readability. Any suggestions on what I"m missing to do this?

badges.JPG

Current version of APEX is 5.1.2, ORDS

Thanks!

This post has been answered by Pierre Yotti on Apr 2 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 30 2018
Added on Apr 2 2018
5 comments
3,801 views