How to get grid cell value given column name in jquery for kendo grid

女生的网名这么多〃 提交于 2019-12-13 03:01:18

问题


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.


回答1:


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;


来源:https://stackoverflow.com/questions/56437553/how-to-get-grid-cell-value-given-column-name-in-jquery-for-kendo-grid

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!