oracle-apexapex

Issue with filtering formatted HTML in Oracle APEX Interactive Grid


I'm encountering an issue with my Interactive Grid (IG) in Oracle APEX, specifically when trying to filter columns that contain formatted HTML. In my grid, I display data as “Display only” (Format → HTML), which works perfectly - the grid cells display the content correctly. However, the problem arises when I attempt to filter the column.

When I click on the column header, a list of distinct values is generated for filtering. These values are shown as plain text with raw HTML tags, rather than rendering the HTML formatting as it appears in the grid cells. I would like to see the formatted HTML in the filter values, just like the cells in the grid.

enter image description here

enter image description here

Writing a custom query for the filter list didn't help because the return and display values are identical. Additionally, it doesn't find rows with HTML tags when I remove them using a regexp_replace in my SELECT statement that builds the filter list.

Has anyone faced a similar issue or could share some guidance or sample code to help implement a custom filtering interface that displays formatted HTML?


Solution

  • What I used once to fix this issue:

    I put this on execute when page load section of the page:

    
    $("#your_ig_id").on("gridactivatecolumnheader", function (event, data) {
      setTimeout(function () {
        $("#your_ig_id_ig_column_header_menu_rows .a-IRR-sortWidget-row").html(
          $("#your_ig_id_ig_column_header_menu_rows .a-IRR-sortWidget-row").text(),
        );
      }, 500)
    })
    

    You can change timeout by your case, but the idea is to catch the click to the column header filter, and then setting the text to html by using JQuery.

    I know this is not a perfect way to fix it, but it fixes it.