Hello,
for the Interactive Grid I am trying to achieve the following:
- I have one item P16_PROJECT_NAME
- I want to have the same project name for every new row the user makes entries
- Currently when a new row is selected the value of the items get vanished
- I am using an IG for saving user entries with one item for the project name
- I tried it with different dynamic actions --> Row Initialization (IG) / Selection Change (IG) --> *
- A initial default value is not possible, since the user gives the project name individually
Basically i want to copy the last entry from the project column to every added new row, so that I can reference them later and assign them.
I hope you can help me with this problem.
Kind regards.
- My Code:
var widget = apex.region('grid').widget();
var grid = widget.interactiveGrid('getViews','grid');
var model = grid.model;
var v_desc;
v_desc = $v("P16_PROJECT_NAME");var myNewRecordId = model.insertNewRecord();var myNewRecord = model.getRecord(myNewRecordId);
model.setValue(myNewRecord, 'PRO_PROZESS', v_desc);
}
Currently it inserts without a break after starting the page ...
Vinish Kapoor
Dynamic action row initialization will work. Follow these steps:
Create a dynamic action on your IG of type Row Initialization.
Create a True action as Set Value and set the following properties:
This will set the IG column value from the project name item.
Suppose you want to set the Project Name item value when the user changes the value in IG. Then follow these steps:
Create a dynamic action on IG column project name, event type Change.
Create a True action Set Value and set the following properties:
Try this and let me know.
Wayne
Hi Vinish,
thank you for your fast response and help. I tried it with the dynamic action and used the JavaScript method to set the column value. Unforrunately, the dynamic action didn't fire.
When I click on add row in the Interactive Grid the whole row remains empty, but I want to have to column set with the project_name.
Vinish Kapoor
I have tested this and it is working. Please check the setting again.
IG > DA Row Initialization > True Action:
Wayne
Well, the approach seems the work for the usual Interactive Grid. But since I am using an Plugin for the Interactive Grid to set the column values it doesn't fire. Furthermore, all my items on my page get refreshed when I add a new row.
I used the following plugin (example): https://apex.oracle.com/pls/apex/f?p=115922:6
When you click on the add row button you will see that the items get refreshed and set to null.
Any idea on how to get it work here.
Thanks for the help. Really appreciate it.
Vinish Kapoor
I check that page, yes, the page items are getting cleared. Now, how will you get the value from that item?
You can try to create a hidden page item for the project name column and then follow those instructions.
Wayne
The item still gets cleared. Any other idea?
I tried:
apex.region("regionStaticID").widget().interactiveGrid("getActions").invoke("selection-duplicate")
But this copies the whole row and not one specific column.
goto150
Assuming you have PROJECT_NAME column, this will give you cell value of the previous record:
You fire this on Row Initialization event.
You may use model.getTotalRecords() to get the total number of records and look for the Project_Name value of last record.
Wayne
Hi goto150,
thats brilliant. Exactly what I was looking for. Thank you very much. Really appreciate it.