I'm trying to load a json into my view. Im using phonegap with sencha touch and when I load the app to my phone the json does not load at all.. It works fine in the browser and in the simulator.
I would really appreciate some help from the experts
Here is the main code that im trying:
the store:
App.stores.freebees = new Ext.data.Store({
model: 'Freebee',
autoLoad: true,
proxy: {
type: 'ajax',
url: 'fixtures/freebees',
reader: {
type: 'json'
}
}
});
the list view:
App.views.FreebeesList = Ext.extend(Ext.List, {
id: 'indexlist',
layout: 'fit',
store: App.stores.freebees,
itemTpl: '{companyName}, {title}, {address}',
listeners: {
'itemtap': function(list, index, item, obj) {
Ext.dispatch({
controller: 'Freebee',
action: 'showDetails',
id: list.getRecord(item).data.id,
lat: list.getRecord(item).data.lat,
longitude: list.getRecord(item).data.longitude,
companyName: list.getRecord(item).data.companyName,
address: list.getRecord(item).data.address,
});
}
},
initComponent: function() {
App.views.FreebeesList.superclass.initComponent.apply(this, arguments);
}
});
Ext.reg('App.views.FreebeesList', App.views.FreebeesList);
the json:
[
{
"id": 1,
"title": "Freebee 1",
"companyName": "F?retaget AB 1",
"address": "Ekuddsv?gen 1 Nacka 131 38 Sweden",
"lat": 59.3058,
"longitude": 18.1463
},
{
"id": 2,
"title": "Freebee 2",
"companyName": "F?retaget AB 2",
"address": "Ekuddsv?gen 2 Nacka 131 38 Sweden",
"lat": 59.305,
"longitude": 18.1478
}
]
See Question&Answers more detail:
os