0
votes

I am attempting to disable the Edit button within an Oracle APEX 5.1.2 Interactive Grid report and also be able to enable the Edit button again.

I have tried the following but to no avail, i.e.:

$('#my-id [data-action="edit"]').prop('disabled', true);

$('#my-id [data-action="edit"]').prop('disabled', false);
1
@RoryMcCrossan - typo and thanks. Unfortunately this still doesn't work.tonyf

1 Answers

2
votes

APEX 5.1 is getting old, especially when it comes to newer components like the Interactive Grid. I'll show you how this can be done in 20.1 (and likely several releases before). Thanks to John Snyders for the help!

To hide the button, you could use:

apex.region("emp").call("getActions").hide("edit");

But you'd probably want to update the grid view and the model too:

var grid = apex.region("emp").call("getViews").grid;
grid.view$.grid("option", "editable", false);
grid.model.setOption("editable", false);

Finally, all of this would update the UI, but could still be undone in the front end. If you really wanted to prevent it you'd have to add a server-side validation (related to IG) that checks the same conditions as the client-side logic.