Reputation: 1911
What I have is the following DTO which gets passed from the service
class ServiceDto
{
public string Name { get; set; }
public string Complete { get; set; }
public string Incomplete{ get; set; }
public List<ServiceDto> Detail{ get; set; }
}
In essence I have a team which has users in it and the data which is returned by the service can look something like this
Team 1 3 5
John Doe 1 3
Mike Low 2 2
Team 2 3 3
Bob Smith 1 2
Alice Smith 2 1
I have implemented the first part of the equastion like this:
$(document).ready(function () {
var element = $("#grid").kendoGrid({
dataSource: {
type: "json",
transport: {
read: "../home/service"
}
}
detailInit: detailInit,
dataBound: function () {
this.expandRow(this.tbody.find("tr.k-master-row").first());
},
columns: [
{ field: "Name", title: "Team Name"},
{ field: "Complete"},
{ field: "Incomplete"}
]
});
});
But I am not sure how to pass the details of each result to the detailInit
init function which looks like this at the momment:
function detailInit(e) {
$("<div/>").appendTo(e.detailCell).kendoGrid({
dataSource: {
type: "json",
transport: {
read: ???
},
},
columns: [
{ field: "Name", title: "User Name" },
{ field: "Complete", title: "Completed task" },
{ field: "Incomplete", title: "Incomplete tasks" }
]
});
}
What do I need to do to pass the data from the parent?
Upvotes: 4
Views: 3874