Kendo Ui scrollable不工作

时间:2017-03-16 05:18:22

标签: jquery kendo-ui kendo-grid kendo-asp.net-mvc scrollable

我正在研究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"  } ]     });

1 个答案:

答案 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"  }
    ]
}