I have created editable interactive grid in oracle apex based on employees table. In IG i have mutiple column such as ename,salary and comm. I want to make the comm column readonly based on the value of salary dynamically . For instance if the value in salary column is 2000 or less the comm column should become readonly. I have write code to achieve this functionality but code not worked as i want. let me share code with you
var salValue = apex.region("mygrid").call.getSelectedRecords()[0].get("SAL");
var commColumnId = “COMM”; // static ID or column name of the COMM column
// Get the interactive grid model
var igModel = apex.region(“mygrid”).call.model;
// Iterate through each row in the grid model
igModel.forEach(function(record) {
var commCell = record.getCellValue(commColumnId);
// Check if SAL value is <= 2000
if (salValue <= 2000) {
// Set COMM column to readonly
commCell.attributes.readOnly = true;
} else {
// Set COMM column to editable
commCell.attributes.readOnly = false;
}
});
// Refresh the interactive grid to apply the changes
apex.region(“mygrid”).call.refresh();
first line returns the error is not a function
muhammad adil islam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.