Kendo UI Grid,可滚动而无需寻呼机

时间:2014-11-07 02:43:15

标签: javascript jquery kendo-ui kendo-grid

我有一个小网格,只有垂直空间才能显示10条记录。应该可以使用垂直滚动条来导航超过前10个记录。我不希望网格中有寻呼机。

我无法让它工作(网格不可滚动):

$(document).ready(function() {
  $("#grid").kendoGrid({
    dataSource: {
      type: "odata",
      transport: {
        read: "http://demos.kendoui.com/service/Northwind.svc/Orders"
      },
       schema: {
          model: {
              fields: {
                  OrderID: { type: "number" },
                  Freight: { type: "number" },
                  ShipName: { type: "string" },
                  OrderDate: { type: "date" },
                  ShipCity: { type: "string" }
              }
          }
      },
      pageSize: 10,
    },
    pageable: false,
    scrollable: true, 
    columns: [{
            field:"OrderID",
            filterable: false
        },
        "Freight",
        {
            field: "OrderDate",
            title: "Order Date",
            width: 120,
            format: "{0:MM/dd/yyyy}"
        }, {
            field: "ShipName",
            title: "Ship Name",
            width: 260
        }, {
            field: "ShipCity",
            title: "Ship City",
            width: 150
        }
    ]
  });
}); 

正如您所看到的,我将pageable设置为false并且可滚动到true,但同样,无法滚动网格。

这是一个掠夺者:http://plnkr.co/edit/JlMsPa4tey4NBsQbsNp5?p=preview

1 个答案:

答案 0 :(得分:3)

我得到了这个工作。我也必须设置高度:

pageable: false,
scrollable: true, 
height: 300,

http://plnkr.co/edit/JlMsPa4tey4NBsQbsNp5?p=preview