New to Kendo UI for jQueryStart a free 30-day trial

Close

methods

Closes the ContextMenu. This method can be prevented to stop the closure.

Parameters:elementElement|jQuery

If called without arguments, will close the ContextMenu. If passed an item, it will be closed (if opened).

Returns:kendo.ui.ContextMenu

Returns the ContextMenu object to support chaining.

<div id="target">Target</div>
<ul id="context-menu">
    <li id="Item1">Item 1
        <ul>
            <li>Sub Item 1</li>
            <li>Sub Item 2</li>
            <li>Sub Item 3</li>
        </ul>
    </li>
    <li>Item 2
        <ul>
            <li>Sub Item 1</li>
            <li>Sub Item 2</li>
            <li>Sub Item 3</li>
        </ul>
    </li>
</ul>
<script>
    // initialize the ContextMenu
    $("#context-menu").kendoContextMenu({
        target: "#target"
    });
    // get a reference to the ContextMenu widget
    var contextMenu = $("#context-menu").data("kendoContextMenu");
    // close the ContextMenu
    contextMenu.close();
</script>
Not finding the help you need?
Contact Support