IG Hack - #1, Add a custom action to the Actions Menu in Interactive Grid in Oracle APEX



Interactive Grid is the power house of Oracle APEX. It provides us with several out of the box features.

This blog explains how to add a custom action to the Actions Menu.

1) Create an Interactive Grid. 

2) Provide a Static ID to the Interactive Grid. (In this example it is emp).

3) Paste the below javaScript code in the Execute When Page Loads section.
     
$("#emp_ig_toolbar_actions_button_menu").menu("option").items.push({
            type: "action",
            id: "upload",
            hide: false,
            label: 'Show Alert',
            icon: 'fa fa-eye',
            action: function() {
                            alert('Alert Triggered Successfully');
            }       
});
     
    In the above code, emp must be replaced with the Static ID that you have provided.

    The values of id, label, icon can be replaced with any other text/icon, based on the requirement.

    As a result of the above code, an Alert pops up on click of the newly added action.  

    Code to show the alert can be replaced with any other javaScript code/function call, based on the requirement.

    Example: apex.event.trigger API can be used to call a custom Dynamic Action.

 

Click here for DEMO   

References: https://docs.oracle.com/database/apex-5.1/AEEUG/what-is-interactive-grid.htm#AEEUG-GUID-DD8997BE-0F32-4591-ADB0-078DC635C10B

https://docs.oracle.com/database/apex-5.1/AEAPI/apex-event-namespace.htm#GUID-023BDCBA-3907-4CFD-A026-F3D6A03FBABE


HAPPY CODING!!! 
Thank you :)



Comments

Popular posts from this blog

Display and Edit CLOB Content in Oracle APEX

Allow Only Number/Decimal values In a Number/Text Field Using JavaScript in Oracle APEX

Copy the value of an Item to Clipboard in Oracle APEX