【问题标题】:How to split a Kendo Grid into a child and parent grid?如何将 Kendo Grid 拆分为子网格和父网格?
【发布时间】:2017-04-07 07:52:07
【问题描述】:

所以我的网格有问题,因为它的列太多。我想做的是将这个网格分成两半,当行扩展时,主网格中只显示一半的列,另一半显示在子网格中。

基本上,父网格的行中的数据必须与子网格的行中的数据相同,仅显示不同的列。

下面的代码应该变成这样的:

这是网格本身:

$("#Materials")
    .kendoGrid({
        dataSource: {
            data: [],
            schema: {
                model: {
                    id: "ID",
                    fields: {
                        ID: { type: "number", editable: false },
                        Code: { type: "string", editable: false },
                        Name: { type: "string", editable: false },
                        ExternalCode1: { type: "string", editable: false },
                        ExternalCode2: { type: "string", editable: false },
                        OtherCode1: { type: "string", editable: false },
                        ServiceMode: { type: "string", editable: false },
                    }
                }
            },
            pageSize: 20
        },
        pageable: true,
        columns: [
            { field: "Code", title:"Code"},
            { field: "Name", title: "Name"},
            { field: "ExternalCode1", title:"External Code1"},
            { field: "ExternalCode2", title:"External Code2"},
            { field: "OtherCode1", title:"Other Code1"},
            { field: "ServiceMode", title:"Service Mode"},
        ],
        editable: false
    });

我正在将数据填充到文档中,以便通过 ajax 调用提高页面加载性能。

【问题讨论】:

    标签: kendo-ui split grid row expand


    【解决方案1】:

    您可以将detailInit 事件中传递的数据用于您的子网格。

    试试这个jsFiddle,如果这对你有用。

    【讨论】:

    • 先生,您是救世主。谢谢,它确实有效。我还想知道您是否知道如何使用 MVC Razor 完成此操作,以供将来参考。谢谢。
    • 不客气!抱歉,我不熟悉 MVC Razor。
    猜你喜欢
    • 1970-01-01
    • 2014-11-19
    • 2013-03-10
    • 1970-01-01
    • 2014-03-26
    • 1970-01-01
    • 2016-05-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多