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

Getting $callback not supported with RadClientDataSource and WebAPI OData feed

1 Answer 175 Views
ClientDataSource
This is a migrated thread and some comments may be shown as answers.
Dennis
Top achievements
Rank 1
Dennis asked on 05 May 2015, 10:45 PM
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>

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 08 May 2015, 10:36 AM
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
Tags
ClientDataSource
Asked by
Dennis
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or