2010 Q2 build context menu problem

2 posts, 0 answers
  1. Lee
    Lee avatar
    6 posts
    Member since:
    Jul 2007

    Posted 21 Jul 2010 Link to this post

    I use a RadContextMenu that I load programmatically with javascript when the user right-clicks.  This has worked perfectly for some time.  However, since I loaded the new (2010 Q2) build, now when I open the menu more than once the items loaded into the menu are always added onto the items that were already there even though I am calling the get_items().clear() function.

    The snippet below is from a simple project that demonstrates the problem:

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title></title>
    </head>
    <body>
        <script type="text/javascript" language="javascript">
            function showMenu(contextMenu, e) {            
                    contextMenu.trackChanges();
                    
                    contextMenu.get_items().clear();                
                
                    var item = new Telerik.Web.UI.RadMenuItem();
                    item.set_text('Sampl Item 1');
                    contextMenu.get_items().add(item);               

                    var item = new Telerik.Web.UI.RadMenuItem();
                    item.set_text('Sampl Item 2');
                    contextMenu.get_items().add(item);

                    var item = new Telerik.Web.UI.RadMenuItem();
                    item.set_text('Sampl Item 3');
                    contextMenu.get_items().add(item);

                    contextMenu.commitChanges();
             }
        </script>
        <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>

        <div id="div1"  style="width: 400px; height: 100px; border: solid 1px Black">
            Click here to see context menu
        </div>
        <telerik:RadContextMenu ID="RadContextMenu1" Runat="server" OnClientShowing="showMenu">
            <Targets>
                <telerik:ContextMenuElementTarget ElementID="div1" />
            </Targets>
        </telerik:RadContextMenu>
        </form>
    </body>
    </html>

    This simple page worked perfectly prior to updating my control library to 2010 Q2.
  2. Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 23 Jul 2010 Link to this post

    Hi Lee,

    Thanks for reporting this.

    It is a known issue. At this moment you can remove items one by one as we have problem with the clear() method.  You can track the status of this issue here.

    Please accept our apologies for the caused inconvenience.

    Greetings,
    Veronica Milcheva
    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
Back to Top