如何在剑道jQuery的jquery中获取给定列名的网格单元格值 [英] How to get grid cell value given column name in jquery for kendo grid
本文介绍了如何在剑道jQuery的jquery中获取给定列名的网格单元格值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
kendo网格中的以下代码是否等效:
Is there a equivalent for below code in kendo grid:
var gridCell = $('.grid-row-selected td.grid-cell[data-name= ' + columnName + ']');
上面的代码用于mvc网格,在该网格中,它会在选择单元格时在选定的网格行上自动提供HTML标记.
Above code is for the mvc grid, where it automatically gives HTML tag on grid-row-selected on selecting a cell.
推荐答案
您可以从网格模型中获取像元值.
You can get the cell value from the model of a grid.
选项1:
$("#grid").data("kendoGrid").dataItem("tbody tr[data-uid='0656dd82-93c5-4159-b4f1-ab62cddce133']").columnName;
data-uid
是您要获取的列的行的唯一ID.
Here data-uid
is the Unique Id of the row of the column which you want to get.
选项2:
如果您使用的是可编辑的Kendo网格,则将k-grid-edit-row
类的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;
这篇关于如何在剑道jQuery的jquery中获取给定列名的网格单元格值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文