|
Replies:
31
-
Pages:
3
[
1
2
3
| Next
]
-
Last Post:
Sep 14, 2009 4:33 PM
Last Post By: khan379
|
|
|
Posts:
3
Registered:
06/03/09
|
|
|
|
Highlight current row on Interactive Report
Posted:
Jun 3, 2009 3:33 AM
|
|
|
|
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
|
|
|
Posts:
1,821
Registered:
05/04/99
|
|
|
|
Re: Highlight current row on Interactive Report
Posted:
Jun 3, 2009 7:58 AM
in response to: John Coenen
|
|
|
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 
|
|
|
Posts:
101
Registered:
01/19/04
|
|
|
|
Re: Highlight current row on Interactive Report
Posted:
Jun 3, 2009 8:13 AM
in response to: Roel
|
|
|
|
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
|
|
|
Posts:
1,821
Registered:
05/04/99
|
|
|
|
Re: Highlight current row on Interactive Report
Posted:
Jun 3, 2009 12:15 PM
in response to: BBA
|
|
|
|
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
|
|
|
Posts:
101
Registered:
01/19/04
|
|
|
|
Re: Highlight current row on Interactive Report
Posted:
Jun 3, 2009 1:06 PM
in response to: Roel
|
|
|
|
|
|
Posts:
31
Registered:
02/24/09
|
|
|
|
Re: Highlight current row on Interactive Report
Posted:
Jun 4, 2009 2:03 AM
in response to: Roel
|
|
|
|
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
|
|
|
Posts:
31
Registered:
02/24/09
|
|
|
|
Re: Highlight current row on Interactive Report
Posted:
Jun 4, 2009 2:04 AM
in response to: Roel
|
|
|
|
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
|
|
|
Posts:
1,821
Registered:
05/04/99
|
|
|
|
Re: Highlight current row on Interactive Report
Posted:
Jun 4, 2009 2:21 AM
in response to: AlexejKl
|
|
|
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.
|
|
|
Posts:
3
Registered:
06/03/09
|
|
|
|
Re: Highlight current row on Interactive Report
Posted:
Jun 4, 2009 2:38 AM
in response to: Roel
|
|
|
|
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
|
|
|
Posts:
1,821
Registered:
05/04/99
|
|
|
|
Re: Highlight current row on Interactive Report
Posted:
Jun 4, 2009 3:00 AM
in response to: Roel
|
|
|
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>
|
|
|
Posts:
3
Registered:
06/03/09
|
|
|
|
Re: Highlight current row on Interactive Report
Posted:
Jun 9, 2009 12:19 AM
in response to: Roel
|
|
|
|
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
|
|
|
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
|
|
|
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
|
|
|
Posts:
67
Registered:
12/18/07
|
|
|
Posts:
67
Registered:
12/18/07
|
|
|
Posts:
1,821
Registered:
05/04/99
|
|
|
|
Re: Highlight current row on Interactive Report
Posted:
Sep 1, 2009 1:16 AM
in response to: khan379
|
|
|
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 : 2500
- 1000000
pts
|
|
Expert : 1000
- 2499
pts
|
|
Pro : 500
- 999
pts
|
|
Journeyman : 200
- 499
pts
|
|
Newbie : 0
- 199
pts
|
|
Oracle ACE Director
|
|
Oracle ACE Member
|
|
Oracle Employee ACE
|
|
Helpful Answer
(5 pts)
|
|
Correct Answer
(10 pts)
|
|