Reputation: 1662
How to get the kendo grid cell value using jquery function?Am new to kendo grid
{field:abc,title:values}
I need the abc value in javascript or jquery?
Upvotes: 1
Views: 17223
Reputation: 1
If anyone still looking for an answer then you can try using following steps:
Note: Basically KendoGrid all rows have it's unique uid property assigned for identify each row. So if you are having uid then you can follow these steps:
var grid = $("#grid").data("kendoGrid");
var tr = grid.dataSource.getByUid("your-row-uid");
var yourFieldValue = tr.yourFieldName;
Even you can get value throught following steps:
First :
var grid = $("#grid").data("kendoGrid");
Second :
var dataItem = grid.dataItem(grid.select());
or
var dataItem = grid.dataItem($(event.target).closest("tr"));
or
var dataItem = grid.dataItem("tr.k-grid-edit-row");
Third:
var yourFieldValue = dataItem.yourFieldName;
Upvotes: 0
Reputation: 5580
I assume your using single row selection for the Grid. This piece of code will grab any value you need off of the selected row.
$('#ProposalGrid').click(function () {
var gview = $(this).data("kendoGrid");
var selectedItem = gview.dataItem(gview.select());
var Guid = selectedItem.YourPropertyName;
})
selectedItem gives you access to all the properties on your model
Upvotes: 8