1

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?

1

2 Answers 2

8

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

Sign up to request clarification or add additional context in comments.

Comments

0

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; 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.