open

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.

Example

<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>

Parameters

x Number|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.

y Number optional

Y coordinate in pixels. If not specified, ContextMenu will assume the first parameter is an anchor element.

Returns

kendo.ui.ContextMenu Returns the ContextMenu object to support chaining.

In this article