Gorupria
Gorupria

Reputation: 61

How to disable edit mode of oracle apex interactive grid on double click?

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

Answers (4)

Karel Ekema
Karel Ekema

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

Ziad Adnan
Ziad Adnan

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

Arif Sher Khan
Arif Sher Khan

Reputation: 585

I have been trying to replicate the same from a long time. Just found a workaround for this.

  1. Create Dynamic Action on Interactive grid on event Double Click
  2. Set Action = Execute JavaScript Code
  3. Use following code in action
    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

damir huselja
damir huselja

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

Related Questions