Sometimes user don’t want to go with add row button for a new row generation on those cases I will show you how to generate new line without using add row button. for this, you will have to follow some simple steps:
- Create Interactive grid using following query and Define a static ID “REPORT_ID”.
SELECT ROWID,
empno,
ename,
job,
deptno
FROM emp
WHERE 1 = 2
- Create Dynamic action with Change Event and Execute JavaScript Action on last column from where you will create a new row.
- Copy and Paste the following JavaScript Code:
apex.region("REPORT_ID").widget().interactiveGrid("getActions").invoke("insert-record")
Note: If You want to add row from the top then must use bellow code instead of above code:
apex.region("REPORT_ID").widget().interactiveGrid("getActions").invoke("row-add-row")