Hello,
Thank you for submitting your query with ComponentArt forum.
It seems that you want to make changes to the context menu control using beginUpdate and endUpdate without closing the menu.
Unfortunately, this behavior is not supported by the Menu control. In order to show the changes, it is necessary that menu control to redraw itself which is done automatically when you use control’s beginUpdate and endUpdate.
However as a workaround you can open the same context menu automatically, by using showContextMenuAtPoint() client side method of the Menu just after your endUpdate().
In case if you are using the ItemSelect client side event of menu to achieve this, you need to cancel this event by using set_cancel on the event argument to restrict the closing of menu.
For example:
function Menu_onItemSelect(sender, eventArgs)
{
..
..
sender.beginUpdate();
sender.get_items().remove(itemIndex_to_remove);
sender.endUpdate();
// you need to store the cordinates x,y using as global varibale
// according to your implementation of opening of context menu
sender.showContextMenuAtPoint(x, y, contextDataNode);
eventArgs.set_cancel(true);
}
Hope it helps you.
Thank you.
Harish Malhotra