0
votes

I have an Interactive Report in Oracle APEX 5.1, i have several columns which i want to Hide but allow the end user to search for a text within the hidden column(s).

I have pasted below in the "Function and Global Variable Declaration" section of JavaScript for the page that contains the interactive report -

function hideColumn(id) {
    $(id).remove();
}

and below in the "Execute when Page Loads" section -

hideColumn('#static-id-of-column-to-hide');

But this hides the column header ONLY, the data for the respective column is still visible. The space for the hidden column is taken up by the next column header. Also, i have tried both $(id).remove(); and $(id).hide(); , result is same.

Any suggestion?

2

2 Answers

0
votes

You could use CSS instead, where your_report is the Static ID for the region, and YOUR_COL usually comes from the column alias. You can verify this by inspecting the element using the browser tool.

#your_report td[headers="YOUR_COL"]
,#your_report th#YOUR_COL
{
  display: none;
}

But you might find the report doesn't always respond as expected, in regard to settling column widths.

If you do go the JS route, you should fire this in a Dynamic Action that's After Refresh of that region, not just on page load.

0
votes

Try this instead of that. (into page inline CSS) It will fix your trouble with column widths maybe.

.a-IRR tr th:nth-child(X), .a-IRR tr td:nth-child(X) {
  display:none;
} 

where "X" is the column number what you want to hide.