Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
930
Popup menu in Firefox using WebMenu
posted

Here's another question for you guys! :)

I've created a pop-up menu for my grid using a webmenu. The pop-up menu pops up fine, but in order to not have the standard browser-pop-up menu displayed I need to do event.cancelBubble=true. It works fine in IE but as Firefox doesn't support the event object (as explained here) I can't cancel the bubble in this browser. As it is now, I just do a check on the browser type, and don't perform the event.cancelBubble=true if it's FF. Here's my code:

function showContextMenu(gridName, cellID, button) {
    if (button == 2) {
        clickedGridName = gridName;
        clickedCellID = cellID;
        if (navigator.appName == "Microsoft Internet Explorer") {
            igmenu_showMenu(MyMenuId, event);
            event.returnValue = false;
            event.cancelBubble = true;
        }
        else {
            igmenu_showMenu(MyMenuId, null);
        }
    }
}

In my code-behind I do:

this.UltraWebGrid1.DisplayLayout.ClientSideEvents.CellClickHandler = "showContextMenu";

The question is: can I make it work so Firefox doesn't display the bubble? Any ideas?

I do have another question regarding the igmenu_showMenu here which you might be able to help me solve if you can help me solve this one? Please take a look at it. Any help appreciated!