Single Article

Filter interactive report by double clicking report cell on APEX 4.2

Category APEX Tricks

I have previously write post Filter interactive report by clicking report cell that was working also in APEX 3.x.

Here is updated version how do same using dynamic action. Code is enhanced also to set search column.

Create dynamic action to page where you have interactive report:

  • Name: Filter report
  • Event: After Refresh
  • Selection Type: Region
  • Region: {select IR region}
  • Condition: -No Condition-
  • Action: Execute JavaScript code
  • Fire On Page Load: True
  • Code:
    var r=$(this.triggeringElement);
    r.find("table.apexir_WORKSHEET_DATA td").dblclick(function(){
     var l=$(this);
     $s("apexir_CURRENT_SEARCH_COLUMN",l.attr("headers")); // comment out this line if you like search from all columns
     $s("apexir_SEARCH",l.text());
     r.trigger("apexrefresh");
    });
    
  • Selection Type: None

Now run page and double click report cell to filter your report.

See working example.

Comment Button

Comments

  • Jari Laine 15 Mar 2016  

    Hi Miguel Angel Gaona Torres,

    I don't have ready example.

    But you need just change dynamic action JavaScript.
    Here is example

    var r=$(this.triggeringElement);
    r.find("table.apexir_WORKSHEET_DATA td").dblclick(function(){
      apex.navigation.redirect("https://www.google.com/")
    });

    Please note that you need change find function selector for APEX 5.

    Regards,
    Jari

        
  • Miguel Angel Gaona Torres 15 Mar 2016  

    HI, do you have an example for double click on report's row to redirect?

    Regards

        
  • Jari Laine 29 Sep 2015  

    Hi Aly,

    Yes, I did forgot if you create new interactive report in APEX 5, table cell heades attribute isn't anymore column name.

    When you remove below line, search is done from all columns, not column you click

    r.find("input[id$=_search_field]").val(l.text());

    If you like search from specific column, you need create e.g. on demand process that returns column name from apex_application_page_ir_col.

    Regards,
    Jari

        
  • aly 28 Sep 2015  

    Hi Jari thanks

    it's work with this code:

    var r=$(this.triggeringElement);
    r.find("table.a-IRR-table td").dblclick(function(){
    var l=$(this);
    r.find("input[id$=_search_field]").val(l.text());
    r.trigger("apexrefresh");
    
    });
        
  • aly 28 Sep 2015  

    Hi jari

    I use this code in D action but not work

    tkans

        
  • Jari Laine 28 Sep 2015  

    Hi Aly,

    Sorry, there is other changes also.

    Please use this JavaScript in dynamic action

    var r=$(this.triggeringElement);
    r.find("table.a-IRR-table td").dblclick(function(){
    var l=$(this);
    r.find("input[id$=_column_search_current_column]").val(l.attr("headers"));
    r.find("input[id$=_search_field]").val(l.text());
    r.trigger("apexrefresh");
    });

    Regards,
    Jari

        
  • aly 28 Sep 2015  

    Hi Jari

     var r=$(this.triggeringElement);
    r.find("table.a-IRR-table td").dblclick(function(){
     var l=$(this);
     $s("apexir_CURRENT_SEARCH_COLUMN",l.attr("headers"));
     $s("apexir_SEARCH",l.text());
     r.trigger("apexrefresh");
    });

    - when I run page and double click report cell to filter my report:not work

    - bat when I copy a value from IR and past it to bar search then double click report cell:work

    (how to past a value of cell in bar search when double click )

    thanks

        
  • Jari Laine 28 Sep 2015  

    Hi Aly,

    You need change selector from table.apexir_WORKSHEET_DATA td to table.a-IRR-table td

    Regards,
    Jari

        
  • aly 27 Sep 2015  

    HI Jari,

    This post example code is for APEX 4.2 and don't work without changes in version 5.x.

    what's the code of javascript to workwith APEX 5.x.

    thanks

        
  • Jari Laine 7 Jul 2015  

    Hi Mo,

    This post example code is for APEX 4.2 and don't work without changes in version 5.x.

    I did make changes to demo and it should work now.

    Regards,
    Jari

        

Global Right Column

Search

Archives

Subscribe in a Reader