我只是在我的 MVC3 项目中使用 Kendo UI Hierarchy Grid。层次结构约为 2 级。我需要使用我自己的自定义操作链接自定义第二级层次结构以添加详细信息。
执行流程很简单。Kendo Grid 将填充默认记录。如果用户选择查看任何记录的内部详细信息,它应该显示另一个层次结构网格,其中包含用于添加新记录的操作链接。
这是我的子网格代码:
<script id="pordersTemplate" type="text/kendo-tmpl">
@Html.ActionLink("Create PoDetails", "Create", "PoDetails", new { id = "#=Id#" }, null)   
 // Here i need to get the current selected ID to use it on the create page.
    @(Html.Kendo().Grid<Models>()
        .Name("PoDetails_#=Id#")
        .Columns(columns =>
        {
            columns.Bound(o => o.Copies).Width(140).ClientTemplate(Html.ActionLink("\\#=Copies\\#", "Edit", "PoDetails", new { Id = "id" }, null).ToHtmlString().Replace("id", "\\#=Id\\#"));
            columns.Bound(o => o.Title).Width(150);
            columns.Bound(o => o.UnitPrice).Width(200);
            columns.Bound(o => o.Account).Width(200);
            columns.Bound(o => o.Status).Width(200);
            columns.Command(command => command.Destroy()).Width(110).Title("Action");
        })
        .DataSource(dataSource => dataSource
        .Ajax()
        .Read(read => read.Action("HierarchyBinding_PoDetails", "Porders", new { PoId = "#=Id#" }))
        .Batch(false)
        .ServerOperation(true)
        .Events(events => events.Error("error_handler"))
        .Model(model => model.Id(p => p.Id))
        .Destroy("Delete", "PoDetails")
        )
        .Pageable()
        .Sortable()
        .Groupable()
        .Filterable()
        .ToClientTemplate()
)
请告诉我一些建议以将此操作链接添加到网格中。
谢谢,