Sencha Touch Charts Ext.data.JsonStore in WebView: Access local json file

You must Login before you can answer or comment on any questions.

Hi,

in a project I am trying to load data as Json in a JsonStore for a SenchaTouch Chart. In the following code (a simple js file) I load the Json Data form a local File.

window.store1 = new Ext.data.JsonStore({
    fields : ['name', 'data1'],
        proxy : {
            type : 'rest',
            url : 'data.json',
            reader : {
                type : 'json',
                root : 'data'
            }
        }
    });      
store1.load();`
The js file is loaded in a webView. If I simply call the js in a html file in the browser, it works. If I try to load the data in my deployed Titanium Mobile App on the iOS Simulator no Data is loaded.

Is there a way to access the data.json file with Titanium?

An equal question was also asked in the Sencha Forum.

THX!

1 Answer

My guess? Its a path issue. Considering referencing the json file relative to its location in the Resource file. If it is in a subdirectory, then reference as url: '/my_directory/data.json'

Your Answer

Think you can help? Login to answer this question!