我有一个主网格,想要一个子表连接到它。子表数据在那里,但是具有import Copy from '@/content/home.json';
的css属性,箭头从不向下移动。
主网格:
display:none
Controls.RenderedGrid = Controls.MainGrid.kendoGrid({
dataSource: null,
filterable: true,
height: "740px",
groupable: true,
sortable: true,
scrollable: true,
pageable: true,
detailInit: Methods.HistoryInit,
resizable: true,
columnResizeHandleWidth: 5,
columnMenu: true,
reorderable: true,
columns: [
{ field: "Id", title: "Id", filterable: false, hidden: false, width: 100 },
{ field: "Date", title: "Date", filterable: false, hidden: false, width: 100 },
{ field: "Text1", title: "Text1", filterable: false, hidden: false, width: 65 },
{ field: "Text2", title: "Text2", filterable: false, hidden: false, width: 65 },
{ field: "Text3", title: "Text3", filterable: false, hidden: false, width: 65 }
]
});
由一个dataSource
按钮填充,该按钮对API进行AJAX调用。
我想要作为子表的详细信息网格:
Search
呈现页面时,子表为Methods.DidHistoryInit = function (e) {
var attachments = new kendo.data.DataSource({
data: [
{ attachmentId: 1321, Name: "Product Roadmap.pptx", Versions: "3", Title: "" },
{ attachmentId: 1322, Name: "Release Timeline.xls", Versions: "1", Title: "" },
{ attachmentId: 1324, Name: "Requirements Analysis.docx", Versions: "2", Title: "" }
],
schema: {
model: {
id: "id",
expanded: true
}
}
});
var versions = [
{ versionId: 1325, attachmentId: 1321, Status: "1321", VersionNumber: "1", Comment: "", Size: "1.23 MB", CreatedBy: "Landry, Kristi", CreationDate: "" },
{ versionId: 1326, attachmentId: 1321, Status: "1321", VersionNumber: "2", Comment: "", Size: "1.87 MB", CreatedBy: "Landry, Kristi", CreationDate: "" },
{ versionId: 1327, attachmentId: 1321, Status: "1321", VersionNumber: "3", Comment: "", Size: "1.91 MB", CreatedBy: "Smith, Michelle", CreationDate: "" },
{ versionId: 1328, attachmentId: 1324, Status: "1324", VersionNumber: "1", Comment: "", Size: "7.41 KB", CreatedBy: "Peters, Stacy", CreationDate: "" },
{ versionId: 1329, attachmentId: 1324, Status: "1324", VersionNumber: "1", Comment: "", Size: "4.43 MB", CreatedBy: "Franklin, Marshall", CreationDate: "" },
{ versionId: 1330, attachmentId: 1322, Status: "1322", VersionNumber: "2", Comment: "", Size: "4.71 MB", CreatedBy: "Peters, Stacy", CreationDate: "" }
];
$("<div/>").appendTo(e.detailCell).kendoGrid({
dataSource: new kendo.data.DataSource({
data: versions,
filter: { field: "attachmentId", operator: "eq", value: e.data.attachmentId }
}),
columns: [
{ field: "versionId", title: "Version Id" },
{ field: "Status" },
{ field: "VersionNumber", title: "Version Number" },
{ field: "Comment" },
{ field: "Size" },
{ field: "CreatedBy", title: "Created By" },
{ field: "CreationDate", title: "Creation Date" }
]
});
,当我单击行上的侧箭头时,什么也没有发生。
知道发生了什么吗?