?
Solved

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

Posted on 2013-12-19
3
Medium Priority
?
373 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 1000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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 syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.
Suggested Courses

770 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