in

Making Interactive Grid Rows Editable on Condition in Oracle Apex

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:

Oracle Apex: Allowed row operations column property.

Save the changes and run the page. Now only the rows will be editable, which are not approved.

Output:

Oracle Apex IG: Rows editable conditionally.

Related Tutorials:

Written by Vinish Kapoor

An Oracle Apex Consultant, Oracle ACE, and founder of foxinfotech.org and orclqa.com a question and answer forum for developers.

guest

3 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments