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

json datasource doesn't work for me

3 Answers 117 Views
ListView (Mobile)
This is a migrated thread and some comments may be shown as answers.
richard
Top achievements
Rank 1
richard asked on 24 Feb 2014, 01:42 PM
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



3 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 24 Feb 2014, 03:59 PM
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!
0
richard
Top achievements
Rank 1
answered on 24 Feb 2014, 06:23 PM
ok it started working and quite honestly i don't even know why....maybe updating to the current internal build helped.

Thanks much though!
0
Kiril Nikolov
Telerik team
answered on 25 Feb 2014, 09:38 AM
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!
Tags
ListView (Mobile)
Asked by
richard
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
richard
Top achievements
Rank 1
Share this question
or