我正在 MasterGrid 中构建一个 ChildGrid。在子网格中,我向每一行添加了一个复选框模板。childgrid复选框的OnSelect,它调用一个函数。任何人都可以帮助我在检查 childgrid 复选框时获取 childgrid 行的详细信息。
提前致谢
$("#grid").kendoGrid({
dataSource: {
data: jdata,
schema: gridschema,
pageSize: 10
},
pageable: true,
detailInit: GetEvents,
selectable: 'multiple',
columns: column,
editable: { mode: "popup" },
scrollable: true,
width:1250
});
function GetEvents(e)
{
var schema= {
model: {
id: "Type",
fields: {
Type: { editable: false, nullable: true },
Date: { type: "date" }
}
}
};
try
{
dataSource = new kendo.data.DataSource({
transport: {
read:function (options) {
jQuery.support.cors = true;
$.ajax(
{
url: serviceURL ,
type: "POST",
dataType: "json",
data:jsonString,
contentType: "application/json; charset=utf-8",
success: function (data) {
var res= jQuery.parseJSON(data.d) ;
options.success(res.events);
} ,
error: function (d,status,error) { alert(d,status,error); }
});
}
},
batch: true,
schema: schema,
filter: { field: "Type", operator: "eq", value: e.data.Type },
pageSize: 5
});
GetEventsByBreachchildGrid= $('<div/>').appendTo(e.detailCell).kendoGrid({
dataSource:dataSource ,
pageable: {
refresh: true,
pageSizes: true
},
selectable: 'multiple',
columns: [
{ field: "Date", title: " Date & Time",template: '#= kendo.toString(Date,"dd/MM/yyyy h:mm:ss tt") #', width: "350px" },
{ field: "Type", title:"Event Type"},
{title:"Action", template: '<input class="events" id="${id}" type="checkbox" onclick="Test()"/>', width: 70 }],
scrollable: false,
sortable: true
}).data("kendoGrid");