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!

Setting row colour based on a hidden value

NazbitFeb 2 2021

Hi there,
I've managed to successfully set the colour of a row in a classic report based on a value shown in that report. The steps I've taken to do that are below.
However what I really want is to set the row colour based off a hidden column value. At the moment when I hide the column this stops working. I'm not in to Java Script but I'm guessing my DA is incorrect and doesn't have visibility of hidden columns?

This is how I've set the page up:
I'm using a Classic Report which has static id "serialreport"
 
Inline CSS for Page (sets all rows to white):

#serialreport td {background-color: #ffffff}

 
Report has this column in the select clause. It generates a flag "A" or "B" (based on line_no being an odd or even number) to determine row colour: 

case to_number(mod(line_items.line_no,2)) WHEN 0 THEN 'A' ELSE 'B' end ROWCOLOUR

 
I have the following DA. It runs on page load and performs the following JS. (When ROWCOLOUR has a value of B set the colour to grey)

$('#serialreport td[headers="ROWCOLOUR"]').filter(function(){
return $(this).text() === 'B'
}).parent().children().css('background-color', '#f2f2f2');

 
This all works as intended when ROWCOLOUR is displayed as a column in the report but if I set this to a hidden column then it does not work.
Do you know how I can achieve this on a hidden column instead?
Thanks

Oracle Database 18c XE Version 18.4.0.0.0
Apex20.1.0.0013
Oracle REST Data Services 19.2.0.r1991647
 Universal Theme

This post has been answered by jariola on Feb 2 2021
Jump to Answer
Comments
Post Details
Added on Feb 2 2021
5 comments
3,193 views