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

Open

methods

Shows the ContextMenu at the specified coordinates in pixels or aligned to the specified anchor. If passed an item, it will be opened. This method can be prevented to stop the ContextMenu from opening.

Parameters:xNumber|Element|jQuery

X coordinate in pixels or the anchor element to which to align. If passed an item - jQuery object or element - it will be 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");
    // open the ContextMenu at 100px, 100px
    contextMenu.open(100, 100);
</script>
Not finding the help you need?
Contact Support