bing api and datasource

2 posts, 0 answers
  1. Piyush Bhatt
    Piyush Bhatt avatar
    166 posts
    Member since:
    Nov 2007

    Posted 13 Jan 2012 Link to this post

    I am trying to decipher the bing api results with datasource but not having success.

    My datasource definiton:
            var dataSource = new{
                transport: {
                    read: {
                        type: "GET",
                        contentType: "applicatino/json; charset=utf-8",
                        url: "",
                        dataType: "jsonp",
                        data: {
                            Query: function() { var search = $("#bingSuggest").val(); return search; },
                            Sources: "web",
                            JsonType: "raw",
                        }, //transport
                        schema: {
                            data: "SearchResponse"
                        change: function() {

    When the JsonType is used as "raw" as soon as the Bing returns results, a javascript error is displayed that the returned response has some syntax error. The reason I believe is - kendo (or jQuery?) tries to send the request with a callback=jquery211212... parameter. But Bing does not recognize this and needs different callback parameter.

    2- I tried passing the json callback.

                            JsonType: "callback",
                            JsonCallback: "onBingSearch"

    Now, bing returns results and no javascript error logged in console - but the callback is not called. 

    Trying to figure out 1) either how to use the 'raw' data or 2) how to get this callback called with the response?


  2. Nikolay Rusev
    Nikolay Rusev avatar
    2289 posts

    Posted 16 Jan 2012 Link to this post

    Hello Piyush,

    Please check the following jsFidlle to see how to setup the DataSource.

    All the best,
    Nikolay Rusev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top