How to get grid cell value given column name in jq

2019-08-19 12:22发布

Is there a equivalent for below code in kendo grid:

var gridCell = $('.grid-row-selected td.grid-cell[data-name= ' + columnName + ']');

Above code is for the mvc grid, where it automatically gives HTML tag on grid-row-selected on selecting a cell.

标签: kendo-grid
1条回答
\"骚年 ilove
2楼-- · 2019-08-19 12:57

You can get the cell value from the model of a grid.

Option 1:

$("#grid").data("kendoGrid").dataItem("tbody tr[data-uid='0656dd82-93c5-4159-b4f1-ab62cddce133']").columnName;

Here data-uid is the Unique Id of the row of the column which you want to get.

Option 2: If you are using editable Kendo grid, k-grid-edit-row class get's added to the selected row. So, you can get the selected row column value like below:

$("#grid").data("kendoGrid").dataItem("tbody tr.k-grid-edit-row").columnName;
查看更多
登录 后发表回答