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

Hide ContextMenu

1 Answer 35 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Peter Ryckaert
Top achievements
Rank 1
Peter Ryckaert asked on 02 Aug 2010, 03:15 PM
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;
}

1 Answer, 1 is accepted

Sort by
0
Peter Ryckaert
Top achievements
Rank 1
answered on 04 Aug 2010, 01:03 PM

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


Thank you me for that answer !
Tags
TreeView
Asked by
Peter Ryckaert
Top achievements
Rank 1
Answers by
Peter Ryckaert
Top achievements
Rank 1
Share this question
or