Hide ContextMenu

2 posts, 0 answers
  1. Peter Ryckaert
    Peter Ryckaert avatar
    16 posts
    Member since:
    Jul 2006

    Posted 02 Aug 2010 Link to this post

    Usually when we click on a contextMenu item, it's supposed  disappear... It would be great I could make it close :-)
    Here some piece of code, is there anything I can do in the eventHandler to force it to close the contextMenu ?

    function keywordTreeviewMenuClicking(sender, eventArgs) {
        var menuItem = eventArgs.get_menuItem();
        action = menuItem.get_value();
        node = eventArgs.get_node(); 
        switch (action) {
            case "Add":
                KeywordManager.AddKeyword(node);
                break;
            case "Delete":
                KeywordManager.DeleteNode(node);
                break;
            case "Edit":
                KeywordManager.EditNode(node);
                break;
            case "ChangeCategory":
                KeywordManager.ChangeCategory(node); 
                break;
        }
        return true;
    }
  2. Peter Ryckaert
    Peter Ryckaert avatar
    16 posts
    Member since:
    Jul 2006

    Posted 04 Aug 2010 Link to this post

    sender.get_contextMenus()[0].hide();


    Thank you me for that answer !
Back to Top