cherbert
25 Aug 2011, 6:15 AM
I have a weird problem whereby my JSON data store is not loading data when I add the app to my home screen.
It works fine in Desktop Safari, Desktop Chrome, Safari on the iPhone & iPad but when I add the page to my Home Screen I just get the Loading graphic and nothing loads.
I have no idea how to debug something that is on the home screen.
I have tried it with JSON and JSON-P i.e type:'ajax' and type:'scripttag'
Neither like to be loaded from the home screen.
Ext.regModel('Cases', {
fields:[{
name:'companyName',
type: 'string'
}]
});
demos.ListStore = new Ext.data.Store({
model: 'Cases',
sorters: 'companyName',
getGroupString : function(record) {
return record.get('companyName')[0];
},
proxy: {
type: 'scripttag',
url: '/finjam/getipadcases',
reader: {
type:'json',
root:'Cases'
}
},
autoLoad: true
});
demos.List = new Ext.Panel ({
items: [{
width: Ext.is.Phone ? undefined : '100%',
height: Ext.is.Phone ? undefined : '100%',
xtype: 'list',
grouped: true,
indexBar: true,
onItemDisclosure: function(record, btn, index) {
Ext.Msg.alert('Tap', 'Disclose more info for ' + record.get('companyName'), Ext.emptyFn);
},
store: demos.ListStore,
itemTpl: '<div class="contact"><strong>{companyName}</strong></div>'
}]
});
My JSON
stcCallback1001({"Cases":[{"companyName":"DEMO COMP 1 LTD"},{"companyName":"DEMO COMP 2 LTD"},{"companyName":"DEMO COMPANY TWO LTD"},{"companyName":"DEMO JAMES LTD"},{"companyName":"DEMO UBUNTU LTD"}]})
It works fine in Desktop Safari, Desktop Chrome, Safari on the iPhone & iPad but when I add the page to my Home Screen I just get the Loading graphic and nothing loads.
I have no idea how to debug something that is on the home screen.
I have tried it with JSON and JSON-P i.e type:'ajax' and type:'scripttag'
Neither like to be loaded from the home screen.
Ext.regModel('Cases', {
fields:[{
name:'companyName',
type: 'string'
}]
});
demos.ListStore = new Ext.data.Store({
model: 'Cases',
sorters: 'companyName',
getGroupString : function(record) {
return record.get('companyName')[0];
},
proxy: {
type: 'scripttag',
url: '/finjam/getipadcases',
reader: {
type:'json',
root:'Cases'
}
},
autoLoad: true
});
demos.List = new Ext.Panel ({
items: [{
width: Ext.is.Phone ? undefined : '100%',
height: Ext.is.Phone ? undefined : '100%',
xtype: 'list',
grouped: true,
indexBar: true,
onItemDisclosure: function(record, btn, index) {
Ext.Msg.alert('Tap', 'Disclose more info for ' + record.get('companyName'), Ext.emptyFn);
},
store: demos.ListStore,
itemTpl: '<div class="contact"><strong>{companyName}</strong></div>'
}]
});
My JSON
stcCallback1001({"Cases":[{"companyName":"DEMO COMP 1 LTD"},{"companyName":"DEMO COMP 2 LTD"},{"companyName":"DEMO COMPANY TWO LTD"},{"companyName":"DEMO JAMES LTD"},{"companyName":"DEMO UBUNTU LTD"}]})