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

Remote Databinding does not work

3 Answers 162 Views
ListView (Mobile)
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 15 Feb 2012, 11:28 AM
Hi,
I try to bind my listview to a remote json-Datasource.
But nothing happens. No error message, but also no data render.

Maybe you can help me, finding out what's wrong with my code:

The list-view HTML Code:
<div data-role="view" id="home" data-transition="slide" data-layout="hbigLayout" data-init="mobileListViewTemplatesInit">
    <h1>Gasthaus zur Wilden Ente</h1>
     <ul id="custom-listview"></ul>   
</div>

The Template for my elements:
<script type="text/x-kendo-template" id="customListViewTemplate">
    <h3 class="item-title">${Name}</h3>
    <p class="item-info">${Beschreibung}</p>
    <a data-role="button" href="${Url}" class="details-link">zum Termin</a>
</script>

The Javascript Code to bind the remote json Data:
var dataSourceTermine = new kendo.data.DataSource({
       transport: {
           read: {
               // the remote service url
               group: "Datum",
               dataType: "json"
           }
       }
   });
 
   function mobileListViewTemplatesInit() {
       $("#custom-listview").kendoMobileListView({
           dataSource: dataSourceTermine,
           template: $("#customListViewTemplate").html(),
           headerTemplate: "<h2>Termine am ${value}</h2>"
       });
   }

The result of the json code also seems ok. You can the it at
http://www.wilde-ente.de/mobile/new/mobileHandler/Termine.ashx

3 Answers, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 16 Feb 2012, 03:38 PM
Hello Thomas,

 
I could not stop anything wrong with the provided code snippets. Is it possible to send us a working test project? Thus I will be able to review the issue locally and advice you further.

Kind regards,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Thomas
Top achievements
Rank 1
answered on 16 Feb 2012, 03:58 PM
Hi,

meanwhile I found the problem.
I called an URL different from the web, I called the index-file.
So I guess this is a kind of Ajax-Security-issue.

But my question now is: if I use Phone gab, for instance, I have to use absolute path for my request.
Will Kendo UI still works as native app, that calls its data from an absolute URL?

Greetings -


Tom
0
Georgi Krustev
Telerik team
answered on 17 Feb 2012, 05:16 PM
Hello Thomas,

 
The issue is not related with KendoUI and depends on the browser. In your case the webkit used by the PhoneGap should allow CORS.

Greetings,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
ListView (Mobile)
Asked by
Thomas
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Thomas
Top achievements
Rank 1
Share this question
or