'How to initiate ojet menu from javascript

We are using below function in java script to trigger oj-dialog and its working fine.

else if(operation === "fmethod"){
            
            var popup = document.getElementById("fPopUp");
            if (!popup.isOpen()) {
                popup.open();
            }
            return;

But when I am using the same function to trigger oj-menu or any other oj element we are getting "popup.isOpen is not a funtion" error.

Can someone let me know what should be the equivalent syntax of javascript to trigger or start oj-menu.



Solution 1:[1]

oj-menu component is not a popup component. So initiate oj-menu we have to use it along with oj-menu-button component.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 jon