This is a migrated thread and some comments may be shown as answers.

[Solved] Asp.Net Web Api 2.2 and OData v4

1 Answer 225 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Luciano Kaesemodel
Top achievements
Rank 1
Luciano Kaesemodel asked on 06 Oct 2014, 12:06 PM
We are in the very start of a Web API using the new OData v4 specification.
Still, I'm not sure about how Kendo can handle v4 OData.

So far, test following the example in http://demos.telerik.com/kendo-ui/grid/remote-data-binding, and I have been asked if there have been support to OData v4 at all.

The closest we got required some work around like this:

$(document).ready(function () {
            dataSource = new kendo.data.DataSource({
                transport: {
                    read: {
                        url: "http://localhost/SAC.OData/Municipio",
                        dataType: "json",
                        type: "GET",
                        beforeSend: function (req) {
                            req.setRequestHeader('Accept', "application/json;odata.metadata=none");
                        }
                    }
                },
                schema: {
                    data: "value",
                    model: {
                        id: "Id"
                    }
                },
                pageSize: 20,
                serverPaging: true,
                serverFiltering: true,
                serverSorting: true
            });

            $("#grid").kendoGrid({
                dataSource: dataSource,
                filterable: true,
                sortable: true,
                pageable: true,
                columns: [
                    { field: "Id" },
                    { field: "Nome" }]
            });
        });


I need to know if there is support for OData v4 specification, or wel'll have to fallback to the v3.

Best regards

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 08 Oct 2014, 09:17 AM
Hi,

Currently the dataSource supports only OData 2. Support for version 3 and 4 is planned for the next official release.

Regards,
Daniel
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Data Source
Asked by
Luciano Kaesemodel
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or