Getting $callback not supported with RadClientDataSource and WebAPI OData feed

2 posts, 0 answers
  1. Dennis
    Dennis avatar
    1 posts
    Member since:
    May 2011

    Posted 05 May 2015 Link to this post

    I'm trying to bind a RadGrid to a Web API 2 OData Feed using the 2015 Q1 version of RadClientDataSource but the GET request to my feed includes a $callback parameter that the OData feed doesn't like.  

    Request URL looks like:

    http://localhost:30569/Employees?$callback=jQuery19107930395885500925_1430850016577&%24inlinecount=allpages&%24format=json

    The feed returns:

    {
      "error":{
        "code":"","message":"The query parameter '$callback' is not supported."
      }
    }

    I've set DataType="JSON" in the <Select> tag but when I view the page source it looks like this setting isn't flowing through to the injected Kendo:

    Sys.Application.add_init(function() {
        $create(Telerik.Web.UI.RadClientDataSource, {"_id":"RadClientDataSource1","schema":{"data":"value","model":{"fields":[{"fieldName":"Id","type":"Number"},{"fieldName":"Name"},{"fieldName":"Department"}]}},"transport":{"serviceType":"odata","read":{"url":"http://localhost:30569/Employees"}}}, null, null, $get("RadClientDataSource1"));
    });

    You can see that the read:  part is missing the dataType: "json"

    What am I missing?

    Here's the RadClientDataSource setup:

    <telerik:RadClientDataSource ID="RadClientDataSource1" runat="server">
        <DataSource>
            <WebServiceDataSourceSettings ServiceType="OData">
                <Select DataType="JSON" Url="http://localhost:30569/Employees" />
            </WebServiceDataSourceSettings>
        </DataSource>
        <Schema DataName="value">
            <Model>
                <telerik:ClientDataSourceModelField FieldName="Id" DataType="Number" />
                <telerik:ClientDataSourceModelField FieldName="Name" DataType="String" />
                <telerik:ClientDataSourceModelField FieldName="Department" DataType="String" />
            </Model>
        </Schema>
    </telerik:RadClientDataSource>
  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 08 May 2015 Link to this post

    Hello,

    Can you please let me know is any console errors appear in the response and if the Web API Request URL opens normally in a new browser tab?
    Find attached a sample runnable application that demonstrates the required functionality. Test ti locally and see if it works for you.


    Regards,
    Maria Ilieva
    Telerik
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top