In Oracle Apex, you can make interactive grid rows editable on condition. For example, you have a flag column APPROVED
in your table, and if the APPROVED
column value is N
; a row can be edited else not. To do this, follow these steps:
Making Interactive Grid Rows Editable Conditionally in Oracle Apex
Create one more column in your interactive grid and set the following properties:
- Column Name: EDITABLE
- Type: Hidden
- Value Protected: No
- Source: SQL Expression
- SQL Expression: decode(approved, 'N', 'U', 'X')
- Data Type: Varchar2
If your interactive grid is based on a query, then you can add the column as follows:
Select empno, ename, sal, decode(approved, 'N', 'U', 'X') EDITABLE From emp;
Make the EDITABLE
column as a hidden column.
After creating the column, click on the Attributes
node of the interactive grid and specify the EDITABLE
column for the Allowed Row Operations Column
property. Below is the screenshot:
Save the changes and run the page. Now only the rows will be editable, which are not approved.
Hello,
Thank you for this article , i wonder how to do the same but on columns.
Regards.
Have the same question! Is there a way we can make only certain rows editable on condition, and other columns editable for all rows?
you can add all required conditions to the separate column using case statement and then apply the rule as given above. Apart from this few columns which are required to make non editable, you can select an option 'Read Only' as Always.