Everlive和Kendo UI网格serverGrouping不起作用

时间:2014-01-11 10:16:29

标签: jquery kendo-ui telerik kendo-grid everlive

我正在尝试为绑定到永久的kendo ui网格启用serverGrouping选项。

为此目的,我从这里开始考虑永久性约束:http://demos.kendoui.com/web/grid/everlive.html

我在该页面上运行此代码(刚添加serverGrouping:true和groupable:true代码)并收到以下错误:“未捕获的TypeError:无法读取未定义的属性'长度'”

这是网格隐藏中的错误还是我做错了什么?

$("#grid").html("");

var everlive = new Everlive({
    apiKey: "3q4sHgIqESXbpvOp",
    scheme: "http"
});

var dataSource = new kendo.data.DataSource({
    type: "everlive",
    transport: {
        // binding to the Order type in Everlive
        typeName: "Order"
    },
    schema: {
        model: {
            id: "Id",
            fields: {
                // default Everlive fields
                CreatedBy:  { type: "string" },
                CreatedAt:  { type: "date" },
                ModifiedAt: { type: "date" },

                // type fields
                Freight:    { type: "number" },
                OrderDate:  { type: "date" },
                ShipName:   { type: "string" },
                ShipCity:   { type: "string" }
            }
        }
    },
    serverPaging: true,
    pageSize: 20,

    serverSorting: true,
    sort: { field: 'OrderDate', dir: 'asc' },

    serverGrouping: true
});

$("#grid").kendoGrid({
    dataSource: dataSource,
    height: 430,
    sortable: true,
    pageable: true,
    groupable: true,
    columns: [
        {
            field: "Freight",
            width: 100
        }, {
            field: "OrderDate",
            title: "Order Date",
            width: 120,
            format: "{0:MM/dd/yyyy}"
        }, {
            field: "ShipName",
            title: "Ship Name"
        }, {
            field: "ShipCity",
            title: "Ship City",
            width: 150
        }
    ]
});

1 个答案:

答案 0 :(得分:1)

Everlive后端显然不支持ServerGrouping。请注意支持的内容here