Appends an item to a ContextMenu in the specified referenceItem's sub menu (or the root ContextMenu if not specified).


<div id="target">Target</div>
<ul id="context-menu"></ul>
    // initialize the ContextMenu
        target: "#target"

    // get a reference to already initialized ContextMenu widget
    var contextMenu = $("#context-menu").data("kendoContextMenu");

            text: "Item 1",
            cssClass: "myClass",                         // Add custom CSS class to the item, optional, added 2012 Q3 SP1.
            url: ""                // Link URL if navigation is needed, optional.
            text: "<b>Item 2</b>",
            encoded: false,                              // Allows use of HTML for item text
            content: "text"                              // content within an item
            text: "Item 3",
            imageUrl: "", // Item image URL, optional.
            items: [{                                    // Sub item collection
                 text: "Sub Item 1"
                 text: "Sub Item 2"
            text: "Item 4",
            spriteCssClass: "mail"                // Item image sprite CSS class, optional.
.k-sprite {
        background-image: url("");


item Object|Array

Item to be appended, specified as a JSON object. An array of objects can also be passed.

referenceItem String|jQuery (optional)

A reference item to append the new item in. If omitted, the new item will be appended to the as a root item.


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

In this article