我正在研究kendo ui的虚拟化,但它无法正常工作我附上我的代码片段有A LOOK。
$('#grid').kendoGrid({
selectable: "multiple cell",
allowcopy: true,
pageSize:2,
scrollable{
virtual:true,
}
columns: [
{ field: "Filename" },
{ field: "Type"},
{ field: "UploadedBy" ,title: "Uploaded By" },
{ field: "UploadedOn" , title: "Uploaded On"},
{ field: "FileLocationType" ,title:"File Location Type" },
{ field: "Size" }
],
dataSource: [
{ Filename: "tea", Type: "beverages" ,UploadedBy: "Ankit" , UploadedOn:"March" , FileLocationType:"Jar" , Size:"XYZ" },
{ Filename: "tea", Type: "beverages", UploadedBy: "Ankit", UploadedOn: "March", FileLocationType: "Jar", Size: "XYZ" },
{ Filename: "tea", Type: "beverages", UploadedBy: "Ankit", UploadedOn: "March", FileLocationType: "Jar", Size: "XYZ" },
{ Filename: "tea", Type: "beverages" ,UploadedBy: "Ankit" , UploadedOn:"March" , FileLocationType:"Jar" , Size:"XYZ" },
{ Filename: "tea", Type: "beverages" ,UploadedBy: "Ankit" , UploadedOn:"March" , FileLocationType:"Jar" , Size:"XYZ" } ] });
答案 0 :(得分:0)
您应该将pageSize
设置放在dataSource中,如下所示:
dataSource: {
pageSize: 2,
data: [
{ Filename: "tea", Type: "beverages" ,UploadedBy: "Ankit" , UploadedOn:"March" , FileLocationType:"Jar" , Size:"XYZ" },
{ Filename: "tea", Type: "beverages", UploadedBy: "Ankit", UploadedOn: "March", FileLocationType: "Jar", Size: "XYZ" },
{ Filename: "tea", Type: "beverages", UploadedBy: "Ankit", UploadedOn: "March", FileLocationType: "Jar", Size: "XYZ" },
{ Filename: "tea", Type: "beverages" ,UploadedBy: "Ankit" , UploadedOn:"March" , FileLocationType:"Jar" , Size:"XYZ" },
{ Filename: "tea", Type: "beverages" ,UploadedBy: "Ankit" , UploadedOn:"March" , FileLocationType:"Jar" , Size:"XYZ" }
]
}