I cannot understand how this works. Basically, I have problem of displaying ListView from dataSource.
Html (view which references template):
And list is never populated. However request was successful and on ds.bind("change" ...) prints all data.
When I change those two lines:
url: "http://demos.kendoui.com/service/products",
dataType: "jsonp",
With lines from Sushi example (having that file in system) - everything works:
url: "content/menu.json",
dataType: "json",
I am completely lost why it is not working in my case...
Html (view which references template):
<div id="index" data-title="My Kendo sushi" data-role="view" data-layout="default" data-show="showMenuView" > <ul id="featured" class="item-list" data-role="listview" data-template="menuTemplate" data-source="ds" data-auto-bind="false" > </ul> </div> <script id="menuTemplate" type="text/x-kendo-template"> #= ProductName # </script>var app;var schema = { data: "", model: {}};var ds = new kendo.data.DataSource({ schema: schema, transport: { read: { dataType: "jsonp", type: "GET" } }, group: "category", error: function() { console.log(arguments); }});var featured = new kendo.data.DataSource({ schema: schema, filter: { field: "featured", operator: "eq", value: true }});ds.bind("change", function() { console.log(schema.data); console.log(ds.data()); featured.data(ds.data());});ds.fetch(); app = new kendo.mobile.Application($(document.body), { transition: "slide" });And list is never populated. However request was successful and on ds.bind("change" ...) prints all data.
When I change those two lines:
url: "http://demos.kendoui.com/service/products",
dataType: "jsonp",
With lines from Sushi example (having that file in system) - everything works:
url: "content/menu.json",
dataType: "json",
I am completely lost why it is not working in my case...