json datasource doesn't work for me

4 posts, 0 answers
  1. richard
    richard avatar
    48 posts
    Member since:
    Dec 2010

    Posted 24 Feb 2014 Link to this post

    Ok, I have wore Google out searching for possible solutions so I hope you here can help me. It is something simple I am sure but I have spent a couple of days (no laughing) on this. All I get is "Loading" on trying to load a list view view from a JSON remote datasource...it works fine if I declare the data locally in the file. so here is the code and what is being returned in Fiddler:

         
    <div data-role="view" data-title="Brokers" id="side-root">
         <ul id="lvBroker" data-role="listview" data-style="inset" data-source="brokers1" data-template="brokerTemplate">
         </ul>
     </div>
     
     <script id="brokerTemplate" type="text/x-kendo-template">
     <table>
       <tr>
         <td>
           #: data.LastName #, #: FirstName # <br/>ph: #: Phone #
         </td>
       </tr>
     </table>
        
     </script>
    var brokers1 = new kendo.data.DataSource({
        transport: {
            read: {
                type: 'GET',
                url: 'http://website.com/api/brokers' + '/' + 1 + '/all',
                dataType: 'json'
                }
            }
        });
     
    $(document).ready(function(){
        var app = new kendo.mobile.Application(document.body, {
            transition: "slide"
            //platform: "android"
        });
      // brokers1.fetch(function(){
      //  brdata = this.data();
      // });
    });

    Fiddler screenshot and loading screenshot attached.

    Thanks much!
    Richard



  2. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2566 posts

    Posted 24 Feb 2014 Link to this post

    Hi Richard,

    I used your setup to create the following working example:

    http://jsbin.com/somub/1/edit

    I guess there is an issue with the data that is coming from the server. When you open the console do you see any errors? 

    Regards,
    Kiril Nikolov
    Telerik
    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. richard
    richard avatar
    48 posts
    Member since:
    Dec 2010

    Posted 24 Feb 2014 Link to this post

    ok it started working and quite honestly i don't even know why....maybe updating to the current internal build helped.

    Thanks much though!
  5. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2566 posts

    Posted 25 Feb 2014 Link to this post

    Hello Richard,

    Glad to hear that the example helped and your project is up and running. In case you have any further questions, please do not hesitate to contact us.

    Regards,
    Kiril Nikolov
    Telerik
    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