I need to get the row data (firstname, lastname) from the current row from a custom command. I need to create a vcard from the custom command and the first name, last name will be used in the back end to dynamically generate the vcard but I have been trying to extract the current row data and have so far been unsuccessful. Here's my code....
any suggestions?
$(function() { var grid = $("#grid").kendoGrid({ dataSource : { pageSize:10, sort : { field : "firstname", dir : "asc" }, transport : { read : "data/getemployees.php" }, schema : { data : "data", total: "data.length" }, }, pageable: true, columns : [{ field : "firstname", title : "First Name" }, { field : "lastname", title : "Last Name" }, { field : "cellphone", title : "Cell Phone" }, { field : "deskphone", title : "Desk Phone" }, { field : "emailaddress", title : "Email Address" },{ command:{text:"vCard", className:"vCardButton"}, title:"vCard", width:"110px" }], sortable:true, }); $("#grid").delegate(".vCardButton", "click", function(e) {
var grid = $("#grid").data("kendoGrid");
var myVar = grid.dataItem(grid.tbody.find(">tr"));
});});any suggestions?