Reputation: 61
I am using an interactive grid in oracle apex. When we double click the grid it goes into an edit mode. I want to get rid of this functionality because my grid is not editable this way.
Upvotes: 4
Views: 6104
Reputation: 200
To prevent going into edit mode, you can extend the existing grid widget's setEditMode public method:
(function($){
var bodyElem = document.getElementsByTagName("body")[0];
bodyElem.addEventListener("load", function(event) {
if (event.target.nodeName === "SCRIPT")
{
// grid subwidget
let srcAttr = event.target.getAttribute("src");
if (srcAttr && srcAttr.includes('widget.grid'))
{
$.widget("apex.grid", $.apex.grid, {
setEditMode: function (editMode, select) {
if (editModeDisabled)
{
return;
}
return this._super(editMode, select);
}
});
}
}
}, true);
})(apex.jQuery);
Upvotes: 0
Reputation: 822
you can hide Edit button from interactive grid by do the following steps :
1- Click the page name
2- in the page attributes search for Java Script
3- type the following java script code in Execute When Page Loads
$('[data-action="edit"]').hide();
4- Save and run your page
Upvotes: 0
Reputation: 585
I have been trying to replicate the same from a long time. Just found a workaround for this.
apex.region("emp").widget().interactiveGrid("getActions").set("edit", false);
Make sure to replace emp
with static ID which you should provide in IG region.
Upvotes: 0
Reputation: 171
if you don't want the user to be able to edit row content, change the column type under Report -> Columns -> Your column -> Type. For example try setting it to Display only so that the users cannot change the content.
Upvotes: 1