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

Kendo Mobile - JSONP DataSource not working

1 Answer 143 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 14 Jan 2014, 12:09 AM
Hello all,

I'm sure this is something simple I'm doing wrong. I am trying to create a data connection to an Blogger.com RSS connection. I'm able to get it working with simple jQuery .ajax connection, but it's not working with the KendoUI datasource. I'm sure I'm forgetting something in the KendoUI connection, perhaps a configuration option or something.

The error I'm getting is: " Uncaught TypeError: Object #<Object> has no method 'slice' ".

I'm sure I'm not the first one wanting to connect to an blogspot/blogger.com RSS feed.

In the end, if I have to use the .ajax method, I suppose I can, it will ultimately be using in Icenium....but I'd prefer to stick to the Kendo API as much as possible so everything works together nicely as I will be using it in Views and with the Drawer and other Icenium functionality.

Working jQuery Code:

    var loadDefault = $.ajax({
        type: "GET",
        dataType: 'jsonp',
        contentType: 'application/jsonp',
        url: "http://www.threelas.com/feeds/posts/default?alt=json-in-script&max-results=55&callback=?",
        data: "",
        success:  function (data) {
            for (var i = 0; i < data.feed.entry.length; i++) {

                var postTitle = data.feed.entry[i].title.$t;
                var postContent = data.feed.entry[i].content.$t;

                console.log(data);
            }
        }
    });


NOT WORKING KENDO UI:

var dataSource = new kendo.data.DataSource({
        transport: {
            read: {
                type: "GET",
                dataType: 'jsonp',
                contentType: 'application/jsonp',
                url: "http://www.threelas.com/feeds/posts/default?alt=json-in-script&max-results=55&callback=?",
                data: ""
            }
        },
        change: function (e) {
            //var view = this.view();
            console.log('got here');
            console.log(this); // displays "Chai"
        }
    });
    dataSource.read();



Thank you in advance for any help... :)

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 16 Jan 2014, 05:02 PM
Hi David,

You have not specified schema for the DataSource and if it receives data in unexpected format, it would not know how to handle it. See similar problem resolved in this Kendo forum thread.

Regards,
Steve
Telerik
You've missed the Icenium Visual Studio Integration keynote? It has been recorded and posted here.
Looking for tips & tricks directly from the Icenium team? Check out our blog!
Share feedback and vote for features on our Feedback Portal.
Tags
General Discussions
Asked by
David
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or