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

RadContextMenu and ExpandDirection="Up"

1 Answer 58 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Pawel
Top achievements
Rank 1
Pawel asked on 15 Feb 2010, 09:54 PM
Hi,
I'm trying to display a context menu that expands upwards from the div element. First time I click the div, everything works fine. If i click only inside the div, the menu and the animation work as expected. The problem starts when I click outside the div when the menu is expanded. The animation seems to break and the next time I click the div, the menu does not start expanding from the top edge of the div but appears below it and slides upwards.

regards
Pawel

<html xmlns="http://www.w3.org/1999/xhtml"
<head runat="server"
    <title></title
</head> 
<body> 
<form id="form1" runat="server"
<asp:scriptmanager id="Sc1" runat="server"
</asp:scriptmanager> 
<div id="divToClick" style="border: solid thin red; width: 50px; height: 25px; position: absolute; 
    top: 300px; left: 100px;" onclick="ShowMenu(event);"
</div> 
<telerik:RadContextMenu ID="RadContextMenu1" runat="server" DefaultGroupSettings-ExpandDirection="Up"
    <Items> 
        <telerik:RadMenuItem Text="Item1" Value="vItem1"
        </telerik:RadMenuItem> 
        <telerik:RadMenuItem Text="Item2" Value="vItem2"
        </telerik:RadMenuItem> 
        <telerik:RadMenuItem Text="Item2" Value="vItem3"
        </telerik:RadMenuItem> 
    </Items> 
</telerik:RadContextMenu> 
 
</form> 
</body> 
<script type="text/javascript"
    function ShowMenu(e) 
    { 
        var contextMenu = $find('RadContextMenu1'); 
        var divToClick = $get('divToClick'); 
        var bounds = Sys.UI.DomElement.getBounds(divToClick); 
        var x = parseInt(bounds.x); 
        var y = parseInt(bounds.y - 75); 
        contextMenu.showAt(x, y); 
        $telerik.cancelRawEvent(e); 
    } 
</script> 
</html> 





1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 18 Feb 2010, 02:32 PM
Hello Pawel,

I've logged this issue and hopefully it will be fixed. Thank you for reporting it.

All the best,
Yana
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.
Tags
Menu
Asked by
Pawel
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or