findByUid

Returns the ContextMenu item by the dataItem's uid.

Example

<div id="target">Target</div>
<ul id="context-menu"></ul>
<script>
    var dataSource = new kendo.data.HierarchicalDataSource({
        transport: {
            read: {
                url: "https://demos.telerik.com/kendo-ui/service/Employees",
                dataType: "jsonp"
            }
        },
        schema: {
            model: {
                id: "EmployeeId",
                hasChildren: "HasEmployees"
            }
        }
    });

    var contextMenu = $("#context-menu").kendoContextMenu({
        target: "#target",
        dataTextField: "FullName",
        dataSource: dataSource
    }).data("kendoContextMenu");


    contextMenu.one("dataBound", function (ev) {
        contextMenu.open();
        var firstItemUid = contextMenu.dataSource.at(0).uid;
        var item = contextMenu.findByUid(firstItemUid);
        contextMenu.open(item);
    });
</script>

Parameters

uid String

The uid of the data item.

Returns

jQuery the item found.

In this article