Dynamic RadMenuItem ContextMenu Duplicates

4 posts, 0 answers
  1. kfrancis
    kfrancis avatar
    69 posts
    Member since:
    Dec 2008

    Posted 21 Jul 2010 Link to this post

    Hey,

    So - I'm having a very strange issue with a RadContextMenu that we're using. Here's the scenario:

    I'm editing this object on the page, when changes occur they are marked in a hidden field. When I right click on the object, it parses the information in the hidden field and creates the RadMenuItems to display in the context menu.

    HOWEVER: I can't seem to get the items to clear. I need to clear the items every time I show the context menu, which is what I believe I'm doing. I will get "item1", "item2", "item1", "item2" if I open it twice.

    Here's the important code:

    var contextMenu = $find(itemContextMenu);
        $telerik.cancelRawEvent(e);
        if ((!e.relatedTarget) || (!$telerik.isDescendantOrSelf(contextMenu.get_element(), e.relatedTarget))) {
        contextMenu.trackChanges();
     
        contextMenu.get_items().clear();
     
        var item1 = new Telerik.Web.UI.RadMenuItem();
        item1.set_text("item1");
        contextMenu.get_items().add(item1);
     
        var item2 = new Telerik.Web.UI.RadMenuItem();
        item2.set_text("item2");
        contextMenu.get_items().add(item2);
     
        contextMenu.commitChanges();
        contextMenu.show(e);
    }

    I've attempted to re-create the scenario in a new rad website, but it works just as expected.

    Anyone have any ideas? Thanks!
  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 22 Jul 2010 Link to this post

    Hello Kori,

    We've already logged this issue and it will be fixed. Thank you for reporting it.

    Regards,
    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. kfrancis
    kfrancis avatar
    69 posts
    Member since:
    Dec 2008

    Posted 22 Jul 2010 Link to this post

    Yana, 

    Is there anyway to make sure we get the solution to the issue (hotfix) when that does get resolved?

    Thanks,
    Kori
  5. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 22 Jul 2010 Link to this post

    Hi Kori,

    You can follow the status of this issue in our public issue tracking system here. Hopefully it will be resolved next week.

    Regards,
    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
Back to Top