This is a migrated thread and some comments may be shown as answers.

IE not showing context menu

3 Answers 112 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Robert Bross
Top achievements
Rank 1
Robert Bross asked on 28 Jun 2010, 06:50 PM
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.

3 Answers, 1 is accepted

Sort by
0
Robert Bross
Top achievements
Rank 1
answered on 28 Jun 2010, 10:05 PM
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.



0
Dimitar Milushev
Telerik team
answered on 01 Jul 2010, 04:16 PM
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
0
Robert Bross
Top achievements
Rank 1
answered on 02 Jul 2010, 02:48 AM
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.

Tags
Menu
Asked by
Robert Bross
Top achievements
Rank 1
Answers by
Robert Bross
Top achievements
Rank 1
Dimitar Milushev
Telerik team
Share this question
or