select

Fires when a menu item gets selected.

Event Data

e.item Element

The selected item

e.type String

The event type as a string - "select".

e.target Element

The current target of the ContextMenu - either the init target or the current element chosen through filter, if specified.

Example

<div id="target">Target</div>
<ul id="context-menu">
    <li>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>
    $("#context-menu").kendoContextMenu({
        target: "#target",
        select: function(e) {
            // handle event
        }
    });
</script>

To set after initialization

<div id="target">Target</div>
<ul id="context-menu">
    <li>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");
     // bind to the select event
     contextMenu.bind("select", function(e) {
         // handle event
     });
</script>
In this article