Oracle APEX 5.1 Hide Interactive Report Column - oracle-apex

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?

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.

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.

Related

How to set two filtering values in one column of links in an interactive report? (Oracle Apex 21.1)

I need help creating a link in Oracle APEX.
I have two Interactive Report pages created in Oracle APEX.
The first page is an Interactive Report for a list of cats. When clicking on that link, filter the second page's Interactive Report by the "fur color" column. Furthermore, I want to always be "white" in addition to the color of the selected row.
I try 2 types of methods to create a link in Link Builder.
Name = IR_FUR_COLOR, Value = &P18_FUR_COLOR. and more one line Value = White
Name = IR_FUR_COLOR, Value = &P18_FUR_COLOR.,White
But they did not work.
How should I do it? Does anyone help me?
Thank you for watching this question!
Link Builder should contain only
Name: IR_FUR_COLOR, Value: &P18_FUR_COLOR
Modify the second Interactive Report's query so that its where clause looks like this:
where fur_color in ('white', :IR_FUR_COLOR)
which means that it'll always filter white color, along with any color you pass from the previous page.
There are variations to that approach; for example, you could create another (hidden) item on the 2nd page and pass white to it and then
where fur_color in (:HIDDEN_FUR_COLOR, :IR_FUR_COLOR)

How run a control-broken IG as collapsed in the first place?

I am using Oracle APEX 21.2.5. I have an Interactive Grid. I did a control break on a specific column. I need to display all grid rows as collapsed when I first run the page. But it's displayed as expanded. Is there a way to do so?
Please put the below code in the Javascript -> Execute When Page Loads section of the page
$("#YOUR_IG_STATIC_ID .a-GV-table tr.a-GV-controlBreak .a-GV-controlBreakHeader .a-Button.js-toggleBreak").click();
Note: In the above code replace YOUR_IG_STATIC_ID with the Static ID of your Interactive Grid region.

Oracle/APEX Adding a row to an Interactive Grid with a Dynamic Action

Currently using APEX 5.1.4
My goal is to have the user press a button, which triggers a new row to be added to the bottom of the IG. This row would also need to have some default values pre-populated, such as the sequence column I have functioning as a primary key.
Doesn't matter how exactly, but I was considering doing it with Javascript. However, none of the methods I have found online, regarding adding a row with Javascript, work.
Also, I have the header bar of the IG removed, so finding the native Add Row Button probably is not an option.
--EDIT--
I found some Javascript that successfully allows me to add a row, however, it adds the row directly underneath the currently selected row. I do not see any methods to automatically select the last row of the IG, and it still doesn't solve that the row needs to have some dynamic values upon instantiation.
Here is the javascript:
This shows all of the available functions that can be invoked ( with .invoke() ):
apex.region("id-region-emp").widget().interactiveGrid("getActions").list()
These following lines both instantiate a new empty row on the IG:
("row-add-row" adds to top of IG, "insert-record" adds underneath currently selected row.)
apex.region("id-region-emp").widget().interactiveGrid("getActions").invoke("row-add-row")
apex.region("id-region-emp").widget().interactiveGrid("getActions").invoke("insert-record")
Better to use below code:
apex.region("detaildataset").widget().interactiveGrid("getActions").invoke("selection-add-row");
Before applying this code make interactiveGrid editable by clicking on attributes and also apply primary key on one column and then apply this code in Execute javascript code:
apex
.region("detaildataset")
.widget()
.interactiveGrid("getActions")
.invoke("selection-add-row");

how to add button for each row record in apex5

I have created an interactive report in apex5.0 with below select:
SELECT article_code,article_desc,order_date, order_status
FROM table_order
WHERE status in ('SHIP','DELIVER','CANCEL');
I want for each row record to have a button that when click it calls another page.
How to do that??
There are a couple options.
Edit the column and change the type of the column to Link.
Create an html link with an href to the page you want. Choose type display, then turn of escaping special characters in the column properties.
Calling another page is declarative, out of the box behaviour, and you'll find such examples in the documentation.
Declarative
http://docs.oracle.com/database/apex-5.1/HTMDB/editing-interactive-reports-page-designer.htm#GUID-B30458D6-9678-40D4-A477-28EE466ED50A
As link column
http://docs.oracle.com/database/apex-5.1/HTMDB/editing-interactive-reports-in-component-view.htm#GUID-48AF053F-0E34-40FA-94FE-19C0400AD499
Manual
http://docs.oracle.com/database/apex-5.1/HTMDB/understanding-url-syntax.htm#HTMDB03019
Using dynamic action http://www.grassroots-oracle.com/2015/12/tutorial-include-action-button-in-report.html

Making an Oracle Apex report table element read-only

Greetings:
Is there anyway to make an apex report table cell (or even the entire report itself) conditionally read-only in Apex 3.2? I don't see the "read-only" box anywhere in the options; tried searching everywhere.
Thanks in advance!
Since the whole tabform is to be made read-only for particular users, you can do this at rendering time rather than using Javascript. However, you would need 2 copies of each column:
Column to be displayed for an authorised user, not readonly
Identical column to be displayed for a non-authorised user, with Element Attributes set to readonly=readonly
Authorisation schemes can be used to control which columns are displayed to the user.
I was hoping to find a way to do this with a single column and a dynamic value for Element Attributes, but I couldn't get it to work.
OK, I had an error in concept. I wanted to make a tabular form read-only. That's why I couldn't see the "read-only" box. If you open the source for the generated page, each column has given an id with the following naming convention:
id="f02_0001"
This table cell is in column 2, row 1. So, you can use JavaScript to loop through a column and modify it's properties. In this example, I use jQuery:
var payments = $("[id^='f08_']"); // get all cells for column 8
// loop through items
$.each(payments, function(){
alert($('#'+this.id).val());
// make whatever changes you want to this.id, such as make read-only
});