1

I'm using this context menu example.

I used the context menu select event like this:

menu = $("#menu").kendoContextMenu({
    target: "#listview-context-menu",
    filter: ".product",
    animation: {
        open: { effects: "fadeIn" },
        duration: 500
    },
    select:  onSelect
});

function onSelect(e) {
    console.log(e);
}

It's working fine, but now I'm getting the current menu object. How can I get selected row data instead?

For example, I have right-clicked on "RE: New version of Telerik Trainer (1st one record)" and then click on reply to sender, so how can I get row object of current row.

Nic
  • 12,220
  • 20
  • 77
  • 105
Jatin Gadhiya
  • 1,955
  • 5
  • 23
  • 42

1 Answers1

1

You can get the reference to the datarow by using the snippet below

function onSelect(e) {                           
    var lst =$("#listview-context-menu").getKendoListView();
    var row = lst.dataItem(e.target);
    console.log(row);
}

Please refer the fiddle here for a demo

Nic
  • 12,220
  • 20
  • 77
  • 105
Amal Dev
  • 1,938
  • 1
  • 14
  • 26