Apex 23.1
had a Master-Detail page where Master contains a column Posted (P178_POST) if its value is ‘Y’ then in Detail (IG) it should hide ‘Add Row’ button otherwise show it, additionally they used F7 key to ‘ add row ’, also this should not work in this condition.
here is code in 'Function and Global Variable Declaration' to map F7 key with action:
// ############################# START HOT-KEYS ############################# //
/* To get code of key please..
visit: http://keycode.info/
OR http://www.cambiaresearch.com/articles/15/javascript-key-codes
License: Free
Resource: www.geekinto.com , [Facebook Group: How to Oracle APEX]
By: Amr Abdeen [Egypt] 28-11-2016
*/
var map = {118: false};
$(document).keydown(function(e) {
if (e.keyCode in map) {
map[e.keyCode] = true;
// Add a new row
if (map[118]) {
/*NOW FIRE YOUR COMMANDS ..*/
//javascript:apex.widget.tabular.addRow();
apex.region("item").widget().interactiveGrid("getActions").invoke('selection-add-row');
}
}
}).keyup(function(e) {
if (e.keyCode in map) {
map[e.keyCode] = false;
}
});
// ############################# END HOT-KEYS ############################# //
regards