1 2 3 Previous Next 32 Replies Latest reply on May 24, 2010 5:11 PM by vamshi617

    Highlight current row on Interactive Report

    JohnCoenen
      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
        • 1. Re: Highlight current row on Interactive Report
          Roel Hartman
          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 ;-)
          • 2. Re: Highlight current row on Interactive Report
            Bhavin
            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
            • 3. Re: Highlight current row on Interactive Report
              Roel Hartman
              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
              • 5. Re: Highlight current row on Interactive Report
                AlexejKl
                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
                • 6. Re: Highlight current row on Interactive Report
                  AlexejKl
                  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
                  • 7. Re: Highlight current row on Interactive Report
                    Roel Hartman
                    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.
                    • 8. Re: Highlight current row on Interactive Report
                      JohnCoenen
                      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
                      • 9. Re: Highlight current row on Interactive Report
                        Roel Hartman
                        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>
                        • 10. Re: Highlight current row on Interactive Report
                          JohnCoenen
                          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
                          • 11. Re: Highlight current row on Interactive Report
                            236835
                            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
                            • 12. Re: Highlight current row on Interactive Report
                              614170
                              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.
                              • 13. Re: Highlight current row on Interactive Report
                                614170
                                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
                                • 14. Re: Highlight current row on Interactive Report
                                  Roel Hartman
                                  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/
                                  1 2 3 Previous Next