Introduction
Interactive Grid (IG) in Oracle APEX is powerful, but mastering a few reusable JavaScript and CSS snippets can significantly improve productivity and user experience. Below are short, practical IG shortcuts that you can quickly plug into your applications.

1. Disable Column Reorder & Resize
Prevent users from rearranging or resizing grid columns.
š Where to use:
Interactive Grid ā Advanced ā JavaScript Initialization Code
function (options) {
options.defaultGridViewOptions = {
reorderColumns: false,
resizeColumns: false
};
return options;
}2. Hide the Save Button
Hide the Save button when changes should be controlled programmatically.
š Where to use:
Page ā Inline CSS
#gridID button[data-action="save"] {
display: none !important;
}3. Process Grid Model on Row Selection
Access column values when rows are selected.
š Where to use:
Dynamic Action ā Event: Selection Change
var model = this.data.model;
for (var i = 0; i < this.data.selectedRecords.length; i++) {
model.getValue(this.data.selectedRecords[i], "<COLUMN_ALIAS>");
}4. Get Selected Row Values Using Grid ID
Fetch column values from the selected row using model indexes.
let gridView = apex.region("<GRID_ID>")
.widget()
.interactiveGrid("getViews")
.grid;
let selectedRecords = gridView.getSelectedRecords();
// Get column indexes
let col1Idx = gridView.modelColumns['<COLUMN_1>'].index;
let col2Idx = gridView.modelColumns['<COLUMN_2>'].index;
if (selectedRecords.length === 1) {
console.log(selectedRecords[0][col1Idx]);
console.log(selectedRecords[0][col2Idx]);
}5. Common Interactive Grid Actions
Trigger built-in IG actions using JavaScript.
// Save changes
apex.region("emp").call("getActions").invoke("save");
// Enable edit mode
apex.region("emp").call("getActions").invoke("edit");
// Refresh grid
apex.region("emp").call("getActions").invoke("refresh");
// Refresh selected rows only
apex.region("emp").call("getActions").invoke("selection-refresh");6. Enable Horizontal Scrollbar in Header
Adds a horizontal scrollbar to the IG header for wide grids.
š Where to use:
Inline CSS
#grid_id .a-GV-w-hdr {
overflow-x: auto !important;
}7. Enable Persistent Row Selection
Keeps selected rows highlighted even after refresh.
š Where to use:
JavaScript Initialization Code
function (config) {
config.defaultGridViewOptions = {
persistSelection: true
};
return config;
}š„ More Useful Oracle APEX Interactive Grid Shortcodes
9. Disable Editing for a Specific Row
if (this.data.record.STATUS === 'CLOSED') {
this.data.record.meta.readonly = true;
}10. Get Row Count
var grid = apex.region("emp").widget().interactiveGrid("getViews","grid");
console.log(grid.model.getTotalRecords());11. Clear All Selected Rows
apex.region("emp").widget()
.interactiveGrid("getViews","grid")
.clearSelection();12. Set Focus on a Column
apex.region("emp").widget()
.interactiveGrid("getViews","grid")
.setActiveCell(recordId, "COLUMN_NAME");13. Refresh Grid After Process
apex.region("emp").refresh();Enjoyed this post? Share it with your friends and family and help us spread the knowledge while appreciating our work.
Hi, Iām Ankur Rai, an Oracle APEX Developer with 6+ years of professional experience in building enterprise applications. I specialize in creating scalable and efficient solutions using Oracle APEX, PL/SQL, and SQL to solve real-world business challenges.
I am a 3X Oracle APEX Professional Certified Developer and also an Oracle ACE Associate Member, actively contributing to the Oracle community by sharing knowledge, insights, and best practices. Through my blogs, I aim to help developers learn, grow, and build better Oracle APEX applications together.



