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

Dynamic RadMenuItem ContextMenu Duplicates

3 Answers 39 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Kori
Top achievements
Rank 2
Kori asked on 21 Jul 2010, 08:46 PM
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!

3 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 22 Jul 2010, 12:11 PM
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
0
Kori
Top achievements
Rank 2
answered on 22 Jul 2010, 01:52 PM
Yana, 

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

Thanks,
Kori
0
Yana
Telerik team
answered on 22 Jul 2010, 02:08 PM
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
Tags
Menu
Asked by
Kori
Top achievements
Rank 2
Answers by
Yana
Telerik team
Kori
Top achievements
Rank 2
Share this question
or