Thread: Highlight current row on Interactive Report

This question is not answered. Helpful answers available: 5. Correct answers available: 1.


Permlink Replies: 31 - Pages: 3 [ 1 2 3 | Next ] - Last Post: Sep 14, 2009 4:33 PM Last Post By: khan379
John Coenen

Posts: 3
Registered: 06/03/09
Highlight current row on Interactive Report
Posted: Jun 3, 2009 3:33 AM
 
Click to report abuse...   Click to reply to this thread Reply
What is the best way to highlight (or identify) the current row in an Interactive Report?

I’ve created an interactive report, based on a custom SQL query, with a link (on the primary key (id)) to give the user the possibility to select a certain record (that will show some additional regions with detail information). How can I identify (highlight, indicator) the selected row in an Interactive Report?

Many thanks for your help,
John
Roel

Posts: 1,936
Registered: 05/04/99
Re: Highlight current row on Interactive Report
Posted: Jun 3, 2009 7:58 AM   in response to: John Coenen in response to: John Coenen
 
Click to report abuse...   Click to reply to this thread Reply
Hello John,

You can do that using jQuery.
Put this code - or something similar that matches your situation - in your Page HTML Header
<style>
.current
{ background : red !important;
}
</style>
<script type="text/javascript">
$(function()
{
  $('a').click(function()
 {  $('td').removeClass('current');
    $(this).parent().parent().children().addClass('current') ;
    return false;
 });
});
</script>

That will add a class (current) to all TD elements in the same row as your anchor.
See this example: [http://apex.oracle.com/pls/otn/f?p=ROEL:CURROW]

Greetings,
Roel
http://roelhartman.blogspot.com/
You can reward this reply by marking it as either Helpful or Correct ;-)
BBA

Posts: 123
Registered: 01/19/04
Re: Highlight current row on Interactive Report
Posted: Jun 3, 2009 8:13 AM   in response to: Roel in response to: Roel
 
Click to report abuse...   Click to reply to this thread Reply
Hi Roel,

I have same requirement but for the standard report and when I move mouse/hover over a row and remove when mouse is not over a row. How can I do that? or What changes do I have to make?

Your help would be appreciated.

Thanks,
Bhavin
Roel

Posts: 1,936
Registered: 05/04/99
Re: Highlight current row on Interactive Report
Posted: Jun 3, 2009 12:15 PM   in response to: BBA in response to: BBA
 
Click to report abuse...   Click to reply to this thread Reply
Edit your Report template
Before Each Row : <tr #HIGHLIGHT_ROW#>
After Each Row :</tr>
And set the Row Highlighting :
Background color for checked row
Background color for current row
BBA

Posts: 123
Registered: 01/19/04
Re: Highlight current row on Interactive Report
Posted: Jun 3, 2009 1:06 PM   in response to: Roel in response to: Roel
 
Click to report abuse...   Click to reply to this thread Reply
Thanks Roel.
AlexejKl

Posts: 31
Registered: 02/24/09
Re: Highlight current row on Interactive Report
Posted: Jun 4, 2009 2:03 AM   in response to: Roel in response to: Roel
 
Click to report abuse...   Click to reply to this thread Reply
Hi Roel,
I tried Your script and highlighting working very nice, but from this time I can’t use the buttons from this page (incl. APEX links – ‘Application xxx’, ‘Edit page yy’... ). Please have You any idea what I am doing wrong?
Thank You very much

Alexej
AlexejKl

Posts: 31
Registered: 02/24/09
Re: Highlight current row on Interactive Report
Posted: Jun 4, 2009 2:04 AM   in response to: Roel in response to: Roel
 
Click to report abuse...   Click to reply to this thread Reply
Hi Roel,
I tried Your script and highlighting working very nice, but from this time I can’t use the buttons from this page (incl. APEX links – ‘Application xxx’, ‘Edit page yy’... ). Please have You any idea what I am doing wrong?
Thank You very much

Alexej
Roel

Posts: 1,936
Registered: 05/04/99
Re: Highlight current row on Interactive Report
Posted: Jun 4, 2009 2:21 AM   in response to: AlexejKl in response to: AlexejKl
 
Click to report abuse...   Click to reply to this thread Reply
Hello Alexej,

The script 'replaces' all anchor tags with the code above, so also the APEX links ;-) . Should be restricted to certain classes or objects (like all anchors in a TD : TD > A). So examine the generated HTML objects/source using firefox with firebug and determine what makes the links you want to change unique (or make them unique by adding a class, an id or a name).

Set the Link Attributes to : class="alink"
and change $('a').click(function()... in the code to : $('.alink').click(function().

Greetings,
Roel
http://roelhartman.blogspot.com/
You can reward this reply by marking it as either Helpful or Correct ;-)

Added code example.
John Coenen

Posts: 3
Registered: 06/03/09
Re: Highlight current row on Interactive Report
Posted: Jun 4, 2009 2:38 AM   in response to: Roel in response to: Roel
 
Click to report abuse...   Click to reply to this thread Reply
Hello Roel,

thanks for your reaction. I put your code in the HTML Header but it is not working.
I will ask a colleague tomorrow too have a closer look, because i'm not familiar with jQuery.
I will let you know the result.

Greetings,
John
Roel

Posts: 1,936
Registered: 05/04/99
Re: Highlight current row on Interactive Report
Posted: Jun 4, 2009 3:00 AM   in response to: Roel in response to: Roel
 
Click to report abuse...   Click to reply to this thread Reply
The solution I described earlier didn't work when you moved to the next set of records or added a (runtime) sort or filter, due to the fact that the $(function) wasn't executed again. A better solution is to change the Link Attributes to : onclick=highLight(this); and add the highLight function to the Page HTML Header (assuming you defined the 'current' style according to the previous post):
<script type="text/javascript">
function highLight( pThis ){
  $('td').removeClass('current');
  $(pThis).parent().parent().children().addClass('current') ;  
}
</script>
John Coenen

Posts: 3
Registered: 06/03/09
Re: Highlight current row on Interactive Report
Posted: Jun 9, 2009 12:19 AM   in response to: Roel in response to: Roel
 
Click to report abuse...   Click to reply to this thread Reply
Hello,

we don't use jQuery, but your suggestions were usefull indeed. We tried to build the
suggested solution with JavaScript and we are very close now.
The only thing is when we navigate to the next set of records we lost the current row
indicator when we go back to the previous page. Furthermore we have to make the
solution more robust.
Tomorrow my colleague will have a look on it (again). We'll keep you informed.

Greetings,
John
roostheim

Posts: 5
Registered: 01/25/01
Re: Highlight current row on Interactive Report
Posted: Jun 10, 2009 1:22 AM   in response to: John Coenen in response to: John Coenen
 
Click to report abuse...   Click to reply to this thread Reply
I wanted the same without using jQuery. Roel's example set me on the right track. To ensure keeping my current row highligthing after using the pagination links I've managed to dynamicly modify the pagination link in the IR using javascript, but I have a little (I hope) problem left.

I've managed to change the pagination link when rendering the page from

<a h ref="javascript:gReport.navigate.paginate('pgR_min_row=16max_rows=15rows_fetched=15')"></a>

to
<a h ref="javascript:gReport.navigate.paginate('pgR_min_row=16max_rows=15rows_fetched=15');highLight(this)"></a>


Unfortunatly my added code does not notice the changes made by the gReport.navigate.paginate code. It does only work when I add an alert (); in my highLight code. This alert will force showing the changes made in the DOM-model by gReport, allowing the highLight function to re-exame the DOM-model and change the pagination link.

Anyone an idea how to overcome this problem ?

Kind regards,

Ralph
khan379

Posts: 70
Registered: 12/18/07
Re: Highlight current row on Interactive Report
Posted: Jun 12, 2009 10:43 AM   in response to: roostheim in response to: roostheim
 
Click to report abuse...   Click to reply to this thread Reply
Hi How have you accomplished this without JQuery ?

i need exactly this behavior - > http://apex.oracle.com/pls/otn/f?p=ROEL:CURROW:763487747488998

though i am opning another page on clicking edit, but i need that row t obe highlighted.
khan379

Posts: 70
Registered: 12/18/07
Re: Highlight current row on Interactive Report
Posted: Aug 31, 2009 5:20 PM   in response to: khan379 in response to: khan379
 
Click to report abuse...   Click to reply to this thread Reply
Hi,
does anyone know how to get below highlighting effect in IR, please help

http://apex.oracle.com/pls/otn/f?p=ROEL:CURROW:763487747488998
Roel

Posts: 1,936
Registered: 05/04/99
Re: Highlight current row on Interactive Report
Posted: Sep 1, 2009 1:16 AM   in response to: khan379 in response to: khan379
 
Click to report abuse...   Click to reply to this thread Reply
Hello,

Not sure about your requirements : Are you opening another window (or browser tab) or another page within the current browser window/tab (and want to navigate back to the report page with the current row highlighted)?

Greetings,
Roel

http://roelhartman.blogspot.com/
Legend
Guru Guru : 2500 - 1000000 pts
Expert Expert : 1000 - 2499 pts
Pro Pro : 500 - 999 pts
Journeyman Journeyman : 200 - 499 pts
Newbie Newbie : 0 - 199 pts
Oracle ACE Director
Oracle ACE Member
Oracle Employee ACE
Helpful Answer (5 pts)
Correct Answer (10 pts)

Point your RSS reader here for a feed of the latest messages in all forums