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

Reading local JSON file - works in simulator, not device

1 Answer 127 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Cliff Gibson
Top achievements
Rank 1
Cliff Gibson asked on 08 Jan 2015, 10:41 PM
I'm building an iOS app using Telerik Platform

I have a json file stored in "data/Books/books.json in my iOS project and when I use the code below in the simulator the ListView renders as expected.  However when I use the AppBuilder app on my iPad the ListView does not display...Anyone have any ideas why this may be???


function GetAvailableBooks()
{
    var AvailableBooks = new kendo.data.DataSource({
        transport: {
        read: "data/Books/books.json"}
    });
    
    AvailableBooks.read();
    
    $("#AvailableBooksList").kendoMobileListView({
        template : $("#AvailableBooksTemplate").html(),
        dataSource: AvailableBooks
    });    
}

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 13 Jan 2015, 09:36 AM
Hi Cliff,

My colleague answered your question in the support ticket you have opened but we will also copy the answer here, in case others are interested in the reply:

​I investigated the issue you are describing and in the end figured out that you have not declared your Kendo UI DataSource correctly. You are setting the url to the transport.read property directly while you have to set it to the transport.read.url property. Furthermore, depending on your .json file, you will have to set a value to the schema.data property to specify where the array of data in your .json file is.

If you have any comments about the suggestion and the results, post in the support thread if this is fine by you, so we avoid double postings.

Regards,
Tsvetina
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
Tags
General Discussion
Asked by
Cliff Gibson
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or