Solved

Need to find a row then highlight the row that is after the found row

Posted on 2013-12-19
3
370 Views
Last Modified: 2013-12-19
Hi,
I need to find "Grand Total" in the below HTML and then change the background-color of the 3rd row or the row that has a cell with the class="apexir_AGGREGATE_VALUE"

I have tried:
$('span.apex_break_headers:contains("Grand Total")') and added .parent() or .closet('tr')
but doesn't work.

<tr><th colspan="3" class="apexir_REPEAT_HEADING" id="BREAK_ORGANIZATION_5">Organization : <span class="apex_break_headers"><!--1-->Grand Total</span>
    </th>
</tr>
<tr><th id="CUSTOMER"><div style="text-align:center;">Customer</div></th>
    <th id="REVENUE"><div style="text-align:center;">Revenue</div></th>
</tr>
<tr class="odd">
  <td  align="left" headers="CUSTOMER BREAK_ORGANIZATION_5">Total
  </td>
  <td  align="right" headers="REVENUE BREAK_ORGANIZATION_5">
    <a href="f?p=888:48:8976543071158::NO:48:P48_PA_PERIOD_NAME,P48_P_PERIOD_NAME,P48_P_ORG_ID,P48_PREV_GL_PERIOD_NAME,P48_CUSTOMER,P48_ORGANIZATION,P48_COLUMN:13-Oct-WK4,OCT-13,81,DEC-12,Total,,REVENUE" >$431,060.34</a>
  </td>
</tr>
<tr >
  <td class="apexir_AGGREGATE_VALUE" style="white-space:nowrap;" align="left" headers="CUSTOMER BREAK_ORGANIZATION_5">
  </td>
  <td class="apexir_AGGREGATE_VALUE" style="white-space:nowrap;" align="right" headers="REVENUE BREAK_ORGANIZATION_5">$431,084,060.34<br />
  </td>
</tr>

Open in new window



others have same structure for subtotals so I need to zero in on the Grand Total span.

<tr><th colspan="3" class="apexir_REPEAT_HEADING" id="BREAK_ORGANIZATION_1">Organization : <span class="apex_break_headers"><!--0-->This Company</span></th></tr>

Open in new window

0
Comment
Question by:bcarlis
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 44

Accepted Solution

by:
Rainer Jeschor earned 250 total points
ID: 39730691
Hi,
something like this?
http://jsfiddle.net/EE_RainerJ/QQ2Q7/

$('span.apex_break_headers:contains("Grand Total")').parents('tr').next().next().next().css( "background-color","red");

Open in new window

0
 
LVL 82

Expert Comment

by:leakim971
ID: 39730695
I don't follow you : http://jsfiddle.net/mFZ3Z/1/
var $Grand_Total_row = $('span.apex_break_headers:contains("Grand Total")').closest("tr");
$Grand_Total_row.css("backgroundColor", "yellow");

Open in new window

0
 
LVL 2

Author Comment

by:bcarlis
ID: 39730747
Awesome! The first one got the row, and I just needed to add .children (which Tony Miller had in the original code)

$('span.apex_break_headers:contains("Grand Total")').parents('tr').next().next().next().children().css( "background-color","red");

Open in new window

0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question