我需要实现分层的剑道网格,父网格正在绑定数据,但子网格未绑定数据,甚至没有击中数据源操作方法。请在下面找到我的代码。任何人都可以让我知道我的代码有什么问题吗?
@(Html.Kendo().Grid<BankruptcyMilestoneViewModel>()
.Name("BankruptcyMileStoneManagement")
.Columns(columns =>
{
columns.Bound(c => c.BankruptcyMilestoneName);
})
.ClientDetailTemplateId("client-template")
.Editable(editable => editable.Mode(GridEditMode.InLine))
.Sortable()
.Filterable()
.Selectable()
.Scrollable(scroll => scroll.Height(600))
.DataSource(dataSource => dataSource
.Ajax()
.Model(model =>
{
model.Id(o => o.BankruptcyMilestoneTrackingId);
model.Field(o => o.BankruptcyMilestoneName).Editable(false);
})
.Read(read => read.Action("GetBankruptcyMilestones", "BankruptcyMilestone").Data("milestoneData"))
.ServerOperation(false)
.Events(s => s.Sync("sync_handler"))
)
)
<script id="client-template" type="text/x-kendo-template">
@(Html.Kendo().Grid<BankruptcyMilestoneDetailsViewModel>
()
.Name("grid_#=BankruptcyMilestoneName#")
.TableHtmlAttributes(new { style = "max-height:200px;" })
.Columns(columns =>
{
columns.Bound(o => o.BankruptcyMilestoneDescription).Width(110);
columns.Bound(o => o.CompletedDate).Width(150);
columns.Bound(o => o.DueDate);
})
.DataSource(ds => ds
.Ajax()
.ServerOperation(false)
.Read(read => read.Action("GetBankruptcyMilestoneDetails", "BankruptcyMilestone", new { milestoneParams = "#=BankruptcyMilestoneName#" }))
)
.ToClientTemplate()
)
</script>