IE not showing context menu

4 posts, 0 answers
  1. Robert Bross
    Robert Bross avatar
    27 posts
    Member since:
    Oct 2012

    Posted 28 Jun 2010 Link to this post

    I'm running into something very wierd with Internet Explorer. For some reason my context menu opens and then closes right away. When I attach code to the Showing, Hiding, Hidden, and Shown events, it goes in the following order: Showing, Shown, Hiding, Hidden. It never stops after it fires the shown event. (in Firefox it stops after the shown event and actually displays the context menu until I click somewhere else). When the Hidden event fires, I can actually see the context menu until I hit ok on that alert box and then it goes trhough the collapse animation. Here is the code that I am using...

    <telerik:RadContextMenu ID="cmnuDesktop" runat="server"
                        OnClientShowing="cmnuDesktop_OnClientShowing"
                        OnClientHiding="cmnuDesktop_OnClientHiding"
                        OnClientShown="cmnuDesktop_OnClientShown"
                        OnClientHidden="cmnuDesktop_OnClientHidden"
                        >
                    <Targets>
                        <telerik:ContextMenuElementTarget ElementID="windowContainer" />
                   </Targets>
                    <Items>
                        <telerik:RadMenuItem Text="Create New Folder" Value="newFolder" NavigateUrl="javascript: createNewFolder();"/>
                    </Items>
                </telerik:RadContextMenu>

    and the Javascript:

    function cmnuDesktop_OnClientShowing(sender, args)
    {
        alert("showing");
    }

    function cmnuDesktop_OnClientHiding(menu, args) {
        alert("hiding");
    }

    function cmnuDesktop_OnClientShown(menu, args) {
        alert("shown");
    }

    function cmnuDesktop_OnClientHidden(menu, args) {
        alert("hidden");
    }

    Has anyone else run into this issue before? The code works fine on Firefox, Opera, Chrome and Safari.

  2. Robert Bross
    Robert Bross avatar
    27 posts
    Member since:
    Oct 2012

    Posted 28 Jun 2010 Link to this post

    I just tried this using IE 8 with Developer tools and set the Browser version to IE 7 and now the context menus work again. So it must be something specific to IE 8. I also traced back through the stack trace/source and can see that there some code in _showAt function that is specifically handling an IE specific issue.

    if (!this._detached)
            {
                this._detach();
                //IE: When initially located in an invisible element, the width is not calculated properly.
                this._getContextMenuElement().style.visibility = "hidden";
                this._getContextMenuElement().style.display = "block";
                this.repaint();
            }

    I wonder if maybe there is an issue with it not detecting IE 8 as an IE browser and not doing some IE specific code that makes it work. Just thinking out loud. Not sure if this helps or not.



  3. Dimitar Milushev
    Admin
    Dimitar Milushev avatar
    555 posts

    Posted 01 Jul 2010 Link to this post

    Hello Robert,

    This is probably something related to your specific scenario as we haven't been able to reproduce the problem (for example on our live demos). What is the target ("windowContainer") of the Context Menu? Is it a RadControl or something else? If possible, can you please open a support ticket and send us a sample project that we can debug locally?

    Regards,
    Dimitar Milushev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  4. Robert Bross
    Robert Bross avatar
    27 posts
    Member since:
    Oct 2012

    Posted 01 Jul 2010 Link to this post

    Thanks for your response Dimitar, However, I was able to finally isolate what the issue was. It was because I had another context menu attached the the same windowContainer. It was just really wierd how it worked in every browser except for IE and even in IE, it still showed the correct menu, it just collapsed it right away. Oh well, if anyone else runs into this issue, make sure that you check to see if there are any other context menus that are attached to the same control.

Back to Top