kendo ui Grid虚拟滚动-滚动在哪里?

时间:2018-06-21 09:46:58

标签: javascript scroll kendo-ui-grid

使用虚拟滚动kendo-ui网格时,没有可见的滚动。

我正在使用虚拟滚动方式来显示数据库中的某些记录,但是我在网格中看不到任何滚动,并且它仅显示前六行。

我不明白我的问题在哪里。

这是我的代码:

  $("#cargoGrid").kendoGrid({
    dataSource: {
        serverPaging: true,
        serverSorting: true,
        pageSize: 20,
        transport: {
            read: {
                url: "/frmPermission/api/readAllCargo",
                type: "POST",
                contentType: "application/json",
                dataType: "json",
            },
            parameterMap: function (options) {
                return JSON.stringify(options);
            }
        },
        schema: {
            data: "data",
            total: "total",
            model: {
                fields: {
                    cargoId: {
                        type: "number"
                    },
                    title: {
                        type: "string"
                    },
                }
            }
        },
    },
    scrollable: {
        virtual: true
    },
    pageable: {
        numeric: false,
        previousNext: false,
        messages: {
            display: "تعداد {2} رکورد نمایش داده شده است",
            empty: "اطلاعاتی برای نمایش وجود ندارد"
        }
    },
    columns: [
        {field: "cargoId", title: "Id", hidden: true},
        {field: "title", title: "نوع بار"},
        {
            filed: "",
            title: "انتخاب",
            template: "<button class='select k-button' onclick=\"clickSelectCargo( #=cargoId# , '#=title#' )\">انتخاب</button>",
            width: "200px"
        }
    ],
    selectable: "single",
    // sortable: true
});

我发现我使用“ sortable:true”时,我单击了它的标题栏,但单击前没有显示虚拟滚动

1 个答案:

答案 0 :(得分:2)

String query = "select Books.BookId, Books.Title, Book_Loans.BranchId, count(Book_Loans.BookLoanId) as NoOfCopies from Book_Loans join Books on Book_Loans.BookId = Books.BookId where Books.BookId = ? group by Book_Loans.BranchId";