我希望能够根据行 ID 获得 1 或 2 的值。
<tbody>
<tr data-uid="4584f83c-5ebe-4463-883e-4113b38e9ef3">
<td>1</td>
<td>Commons</td>
<td>Amherst</td>
<td>Massachusetts</td>
<td><a class="k-button k-button-icontext k-grid-edit" href="#"><span class="k-icon k-edit"></span>Edit</a><a class="k-button k-button-icontext k-grid-D" href="#"><span class=" "></span>D</a></td>
</tr>
<tr class="k-alt" data-uid="4146df62-1788-4296-8ff9-f8b523a4e844">
<td>2</td>
<td>Chase</td>
<td>Amherst</td>
<td>Massachusetts</td>
<td><a class="k-button k-button-icontext k-grid-edit" href="#"><span class="k-icon k-edit"></span>Edit</a><a class="k-button k-button-icontext k-grid-D" href="#"><span class=" "></span>D</a></td>
</tr>
这是我尝试过的:
var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
var propId = $("#Grid").data("kendoGrid").tbody.find("tr[data-uid='" + dataItem.uid + "']").first("td").html();
和
var dataItem = this.dataItem($(e.currentTarget).closest("tr"));
var propId = $("#Grid").data("kendoGrid").tbody.find("tr[data-uid='" + dataItem.uid + "']").first("td").text();
第二个几乎起作用了,但它返回TD
了TR
.