Javascript 停止剑道从自动生成网格列

Javascript 停止剑道从自动生成网格列,javascript,mvvm,kendo-ui,kendo-grid,Javascript,Mvvm,Kendo Ui,Kendo Grid,我将剑道网格嵌套在另一个剑道网格行中,作为“细节”模板。不过,我遇到了一个非常令人沮丧的问题;Kendo似乎在为我自动生成细节网格的列,尽管我自己已经定义了它们,并且它显示了很多我不想显示的列 以下是原始网格: $("#ResellerBillingGrid").kendoGrid({ dataSource: viewModel.resellerDataSource, editable: false, groupable: false, sortable: tru

我将剑道网格嵌套在另一个剑道网格行中,作为“细节”模板。不过,我遇到了一个非常令人沮丧的问题;Kendo似乎在为我自动生成细节网格的列,尽管我自己已经定义了它们,并且它显示了很多我不想显示的列

以下是原始网格:

$("#ResellerBillingGrid").kendoGrid({
    dataSource: viewModel.resellerDataSource,
    editable: false,
    groupable: false,
    sortable: true,
    pageable: true,
    scrollable: false,
    filterable: {
        extra: false,
        messages: {
            isTrue: "Yes",
            isFalse: "No",
            info: " "
        }
    },
    filterMenuInit: filterMenuInit,
    detailTemplate: kendo.template($("#resellerDetailTemplate").html()),
    detailInit: viewModel.detailInit,
    columns: [
        { field: "DisplayName", title: "Reseller" }
    ]
});
这是我的viewmodel以及网格细节:

var viewModel = new kendo.observable({
    resellerDataSource: new kendo.data.DataSource({
        transport: {
            read: {
                url: "/Host/Billing/GetResellers",
                dataType: "json",
                type: "GET"
            }
        },
        pageSize: 20,
        schema: {
            model: {
                fields: {
                    DisplayName: { type: "string" },
                    ResellerOrganizationsDataSource: [
                        {
                            Id: { type: "number" },
                            OrgDisplay: { type: "string" },
                            UserCount: { type: "number" },
                            PricingTier: {
                                Id: { type: "number" },
                                Name: { type: "string" },
                                PricePerUser: { type: "number" },
                                Total: { type: "number" }
                            }
                        }
                    ]
                }
            }
        }),
        detailInit: function (e) {
            var detailRow = e.detailRow;

            detailRow.find(".resellerOrgsGrid").kendoGrid({
                dataSource: {
                    data: e.data.ResellerOrganizationsDataSource,
                    pageSize: 10,
                    schema: {
                        model: {
                            fields: {
                                Id: { type: "number" },
                                OrgDisplay: { type: "string" },
                                UserCount: { type: "number" },
                                PricingTier: {
                                    Id: { type: "number" },
                                    Name: { type: "string" },
                                    PricePerUser: { type: "number" },
                                    Total: { type: "number" }    
                                }
                            }
                        }
                    }
                },
                scrollable: false,
                sortable: true,
                pageable: true,
                columns: [
                    { field: "OrgDisplay", filterable: { ui: orgFilter }, title: "Name" },
                    { field: "PricingTier.Name, title: "Pricing Tier", filterable: { ui: tierFilter } ),
                    { field: "PricingTier.PricePerUser", title: "Price Per User", format: "{0:C2}" },
                    { field: "UserCount", title: "Total Users" },
                    { field: "PricingTier.Total", title: "Total", format: "{0:C2}" }
                ]
            }
        });
    }
});
现在最疯狂的是,即使我从
detail
网格中删除了列定义,所有“自动生成”的列仍然存在

下面是我得到的一个屏幕截图-请注意,即使只定义了5个列,该行细节中的所有列都是如何显示的:


以前有没有人遇到过这个问题,或者对造成这个问题的原因有什么想法?

我找到了答案。问题是,我在
数据源
内定义了我的列和网格的其他属性,而不是在它之外。现在一切正常