Evaluate Consulting Services

Custom Action Menu in Oracle APEX Reports


var menu$ = $(“<div id=’actionsMenu’></div>”);

$(“body”).append(menu$);

menu$.menu({

    iconType: “fa”,

    items: [

        {

            type: “action”,

            labelKey: “ACTION_EDIT”,

            icon: “fa-pencil”,

            action: function(menu, btn) {

                // open dialog page 3 for the specific department

                // the dialog url including checksum is in the data-link attribute 

                // on the button that opens the menu

                var link,

                button$ = $(btn);

                // get the link and unescape unicode chars

                link = button$.attr(“data-link”).replace(/u(dddd)/g,

 function(m,d) {

                    return String.fromCharCode(parseInt(d, 16));

                });

                apex.navigation.dialog(link,

                                       {title: apex.lang.getMessage(“TITLE_DEPT”), 

                                        resizable: true, draggable: true, height: 280,

 width: 460}, 

                                       “t-Dialog–standard”,

                                       button$);

            },

            disabled: function() {

                var btn$ = $(“button.is-active.js-menuButton”);

                return btn$.attr(“data-locked”) === “Y”;

            }

        },

        {

            type: “action”,

            labelKey: “ACTION_EMP”,

            icon: “fa-users”,

            action: function(menu, btn) {

                // go to the employee page (2) for the specific department

                var btn$ = $(btn);

                apex.navigation.redirect(apex.util.makeApplicationUrl({

                    pageId:2,

                    itemNames: [“P2_DEPTNO”, “P2_TITLE”],

                    itemValues: [btn$.attr(“data-id”), btn$.attr(“data-title”)]

                }));

            }

        }

    ]

});

Leave a Comment

Your email address will not be published. Required fields are marked *