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

can't get jsonp to DataSource

0 Answers 120 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
Wirusiux
Top achievements
Rank 1
Wirusiux asked on 23 May 2012, 09:44 AM
Here is calling code:
$(document).ready(function () {
    var tipaiindeksai = new kendo.data.DataSource({
        transport: {
            read: {
                url: "http://localhost:11336/Mobile/GetTipaiIrIndeksai",
                dataType: "jsonp",
                jsonp: "d"
                //cache: false,
                //jsonpCallback: "callback"
            }
        },
        schema: {
            data: ""
        }
    });
    var ats = tipaiindeksai.read();

and tipaiindeksai.read(); returns undefined.

The call looks like this:
http://localhost:11336/Mobile/GetTipaiIrIndeksai?d=jQuery1710758081869687885_1337762101342&_=1337762101615

And it returns:
HTTP/1.1 200 OK
Server: ASP.NET Development Server/10.0.0.0
Date: Wed, 23 May 2012 08:35:01 GMT
X-AspNet-Version: 4.0.30319
X-AspNetMvc-Version: 4.0
Cache-Control: private
Content-Type: application/json; charset=utf-8
Content-Length: 939
Connection: Close
 
jQuery1710758081869687885_1337762101342([{"ID":0,"pav":"asd","indeksas":141.8},{"ID":10,"pav":"asdasd","indeksas":101.7}])

So it returns something, but it seems that DataSource can't parse it correctly as its result is undefined.
Please help to make it work :)

No answers yet. Maybe you can help?

Tags
Data Source
Asked by
Wirusiux
Top achievements
Rank 1
Share this question
or