How To Set OData-V4 xhrFields When Using Server Wrapper Fluent Syntax?

2 posts, 1 answers
  1. Russell
    Russell avatar
    9 posts
    Member since:
    Apr 2015

    Posted 17 Nov 2015 Link to this post

    How can one set xhrFields {withcredentials: true} when using an OData-V4 data source in an MVC Server Wrapper?

    I've gotten this far in the data source using the Fluent API:


    .DataSource(dataSource => dataSource
                        .Transport(transport =>
                            transport.Read(read => read.Url("https://xxx/OData/Employee/FindEmployees"));


     But I need to be able to include credentials like am doing here:

                        placeholder: "Select employee",
                        dataTextField: "FullName",
                        dataValueField: "EmpID",
                        filter: "startswith",
                        autoBind: false,
                        minLength: 3,
                        dataSource: {
                            type: "odata-v4",
                            serverFiltering: true,
                            transport: {
                                read: {
                                    url: "",
                                    xhrFields: {
                                        withCredentials: true}




  2. Answer
    Rosen avatar
    3247 posts

    Posted 19 Nov 2015 Link to this post

    Hello Russell,

    You should use the overload of the Read method which accepts an object, similar to the following:

        url = "foo/bar",
        xhrFields =  new { withCredentials = true }

    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top