Asp.net 获取剑道层次网格子网格中的第一个单元格数据
我使用剑道等级网格。在子网格中,我放置了一个“编辑”按钮。因此,我需要在单击编辑按钮时获取子行第一列数据(ID) 我的detailInit函数和ClickB函数在这里Asp.net 获取剑道层次网格子网格中的第一个单元格数据,asp.net,kendo-grid,Asp.net,Kendo Grid,我使用剑道等级网格。在子网格中,我放置了一个“编辑”按钮。因此,我需要在单击编辑按钮时获取子行第一列数据(ID) 我的detailInit函数和ClickB函数在这里 function detailInit(e) { var _Po_sectionID =e.data.SectionID; $("<div/>").appendTo(e.detailCell).kendoGrid({
function detailInit(e) {
var _Po_sectionID =e.data.SectionID;
$("<div/>").appendTo(e.detailCell).kendoGrid({
dataSource: {
transport: {
read: _PostionsBySectionUrl + _Po_sectionID
},
schema: {
data: "Data",
total: "Count"
},
},
scrollable: false,
sortable: true,
pageable: true,
{ field: "ContainerID", title: "Possition ID",hidden:true },
{ field: "ContainerName", title: "ContainerName",hidden:true },
{
title: "Action", width: 95, command: [
{
id: "edit",
name: "edit",
click: OnPositionRowSelect,
template: "<a class='k-button k-grid-edit' href='' style='min-width:16px;'><span class='k-icon k-edit'></span></a>"
}
]},
]
});
}
您可以使用最近的()函数获得它。 ()
function OnPositionRowSelect(e) {
e.preventDefault();
_ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _
alert("Container Id : "+ ContainerID);
}
function OnPositionRowSelect(e) {
e.preventDefault();
var element = $(e.target);
var grid = element.closest("[data-role=grid]").data("kendoGrid");
var dataItem = grid.dataItem(element.closest("tr"));
alert(dataItem.ContainerID);
}