claytantor
26 Nov 2010, 2:39 PM
Yes it is true I am very new to Sencha, and Ext but I am really confused why this returns a record count of 0, when the app loads it seems to parse the JSON just fine, but somehow there are no records. Its bizarre because I have twiddled with this for many hours and this is the "by the book" as I can tell. Looked on forums already too I promise.
/**
* simple json store
*/
Ext.regApplication({
name: "json",
icon: 'resources/images/icon.png',
glossOnIcon: false,
phoneStartupScreen: 'resources/images/phone_startup.png',
tabletStartupScreen: 'resources/images/tablet_startup.png',
/**
* This is called automatically when the page loads.
*/
launch: function() {
// create the Data Store
var authInfosStore = new Ext.data.Store({
storeId: 'authInfosStore',
proxy: {
type: 'ajax',
url: 'http://dev.ratecred.com/oauth/url.json',
reader: {
type: 'json',
idProperty: 'authenticationURL',
root: 'urls',
totalProperty: 'count'
}
},
fields: [
{name: 'authenticationURL'},
],
});
authInfosStore.load();
console.log("loaded:"+authInfosStore.getCount());
}
});
{
"count" : 1,
"urls" : [{"authenticationURL": "https://auth.com/oauth/authenticate?oauth_token=PE0XNed8nMCphIk2oOmLjphUtWJmHvLzFvRWRHriUc"}]
}
/**
* simple json store
*/
Ext.regApplication({
name: "json",
icon: 'resources/images/icon.png',
glossOnIcon: false,
phoneStartupScreen: 'resources/images/phone_startup.png',
tabletStartupScreen: 'resources/images/tablet_startup.png',
/**
* This is called automatically when the page loads.
*/
launch: function() {
// create the Data Store
var authInfosStore = new Ext.data.Store({
storeId: 'authInfosStore',
proxy: {
type: 'ajax',
url: 'http://dev.ratecred.com/oauth/url.json',
reader: {
type: 'json',
idProperty: 'authenticationURL',
root: 'urls',
totalProperty: 'count'
}
},
fields: [
{name: 'authenticationURL'},
],
});
authInfosStore.load();
console.log("loaded:"+authInfosStore.getCount());
}
});
{
"count" : 1,
"urls" : [{"authenticationURL": "https://auth.com/oauth/authenticate?oauth_token=PE0XNed8nMCphIk2oOmLjphUtWJmHvLzFvRWRHriUc"}]
}