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