Remote Databinding does not work

4 posts, 0 answers
  1. Thomas
    Thomas avatar
    21 posts
    Member since:
    Oct 2011

    Posted 15 Feb 2012 Link to this post

    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
  2. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 16 Feb 2012 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
  4. Thomas
    Thomas avatar
    21 posts
    Member since:
    Oct 2011

    Posted 16 Feb 2012 Link to this post

    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
  5. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3707 posts

    Posted 17 Feb 2012 Link to this post

    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!
Back to Top
Kendo UI is VS 2017 Ready