Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Dynamically set options on an Interactive Grid

Jeffrey KempMar 12 2018 — edited Mar 13 2018

I need an IG to be editable unless the user has selected a particular option on the page (in this case, a "show deleted" checkbox).

So far, I have a DA on the checkbox which does an ordinary Refresh action on the IG.

The Javascript Code on the IG region attributes has this:

function (options) {

  //disallow adding rows when showing recyclebin

  var enableops = (($v("P1_DELETED_IND")=="Y")?false:true);

  options.editable.allowedOperations.create = enableops;

  options.editable.allowedOperations.update = enableops;

  options.editable.allowedOperations.delete = enableops;

  return options;

}

This appears to only work when the page is initially loaded. I want to effectively re-execute this code whenever the checkbox is changed, and I don't want to fallback to doing a page reload whenever the checkbox is changed.

I've tried calling setOption like the following but the only thing that seems to change is that the existing records cannot be edited - the grid still allows records to be Added, Duplicated, Deleted, and the Edit/Save/Add Row buttons are still visible:

apex.region("budgetlines").widget().interactiveGrid("getViews","grid").setOption("allowEditMode",false);

apex.region("budgetlines").widget().interactiveGrid("getViews","grid").setOption("allowDelete",false);

apex.region("budgetlines").widget().interactiveGrid("getViews","grid").setOption("allowInsert",false);

apex.region("budgetlines").refresh();

Application Express 5.1.4.00.08

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 10 2018
Added on Mar 12 2018
4 comments
2,993 views