0

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

为此,我从这里以everlive绑定为例:http ://demos.kendoui.c​​om/web/grid/everlive.html

我在该页面上运行此代码(刚刚将 serverGrouping:true 和 groupable:true 添加到代码中)并收到以下错误:“Uncaught TypeError: Cannot read property 'length' of undefined”

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

$("#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
        }
    ]
});
4

1 回答 1

1

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

于 2014-01-11T17:43:41.957 回答