Jump to content

Need Help in Defining the Right QuerySelector


Recommended Posts

The situation:

  1. I am not a Java programmer, and am trying to learn it as fast as I can :mellow:.
  2. I have a Reports data page.
  3. I am trying to manipulate the font colors based on a comparison against another table field. There are nine fields (columns) for each row of returned results.

image.thumb.png.957ac90b4bc4b03b8e3110cb986616db.png

  1. In the Footer of the page, I have inserted the following Java Script:

<script>
document.addEventListener('DataPageReady', function (event) {
var isi = document.querySelector("td[class*='cbResultSetTableCellNumberDate'] span");

if( isi.innerHTML>= ([@authfield:Calories]*.20)){
    isi.parentNode.style.color = '#FF9900';
}
else{
    isi.parentNode.style.backgroundColor = '#2F5597';
}
});

</script>

  1. When I run the script and inspect the page, I see this. I know that I am not selecting the right Selector and have tried several different levels, but I can't make it work. As I stated before, I am not a Java pgrm and am flying blind.

image.thumb.png.eeaa3d2967fd7fafc710883af97d7b4d.png

Can someone please help me?

Lynda

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...