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

RadContextMenu.show() issue with IE

1 Answer 59 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Craig Dobson
Top achievements
Rank 1
Craig Dobson asked on 19 Jul 2011, 01:33 PM

I have a context menu that I wish to show in response to a client-side click event. This works in IE9 but not in any earlier version, nor if in compatibility mode.

After a bit of digging, and tracing into the "show()" method it appears that the method is relying on the passed event object having a "target" property, which IE appears not to support (at least prior to IE9).  Instead, IE seems to use a property called "srcElement" instead.

So for the benegit of anyone else struggling with this, here's my patched code that now seems to work ok...

function onButtonClickToShowMenu(e) {
    if (!e.target && e.srcElement)
        e.target = e.srcElement;
    var menu = $find('mymenuId');
    menu.show(e);
}

1 Answer, 1 is accepted

Sort by
0
Kate
Telerik team
answered on 22 Jul 2011, 12:02 PM
Hello Craig,

We have not been contacted about a similar issue before. However, we appreciate the fact that you share the solution of your scenario and therefore I updated your telerik points.

Kind regards,
Kate
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
Menu
Asked by
Craig Dobson
Top achievements
Rank 1
Answers by
Kate
Telerik team
Share this question
or