Я вставляю сетку кендо внутри другой строки сетки кендо в качестве шаблона «подробно». Тем не менее, у меня есть эта чрезвычайно неприятная проблема; Кажется, что Kendo автоматически генерирует столбцы для детальной сетки для меня, хотя я сам их определил и отображает много столбцов, которые я не хочу отображать.Стоп 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:
Кто-нибудь работать в этом вопрос до или есть идеи о том, что может быть причиной этого?