I'm trying to create a contextMenu usig the kendoContextMenu widget. This works using the following code.
$("#contextMenu").kendoContextMenu({
target: "#tree",
filter: ".k-item",
select: function(e) {
    alert("Selected");
},
dataSource:
[
    { text: "Item1"},
    {
        text: "SubMenu1",
        items: [
            { text: "Item1" }
        ]
    },
    {
        text: "SubMenu2",
        items: [
            { text: "Item1" }
        ]
    }
]
});
But I want to specify a function for each item to execute when the item is clicked. I don't want to determine what to execute based on the text contents.
I've tried to add a click item in the datasource but that doesn't seem to work.
                        
Kendo ContextMenu doesn't have this feature, but you have 2 options:
First, configure context menu using html with
onclickevents:Second, if you can ensure name uniqueness you can add click properties in
dataSourceconfiguration and then on context menu select event you can search indataSourceappropriate item and execute attached function manually.