PDA

View Full Version : Am I using this wrong? I am just trying to get my JSON data from store



aonjavadev
9 Feb 2011, 11:30 AM
Am I using this wrong? I am just trying to get my JSON data from store





var glecs;

Ext.regModel('glecsModel', {
fields: [ 'glecs' ]
});

var store = new Ext.data.JsonStore({
model: 'myRetrievedDataModel',
proxy: {
type: 'ajax',
url : '/flex/MobileController?q=gg'
},
reader: {
root: 'glecs'
}
});

store.load();

glecs = store.getAt(0);


My data looks like this:


{"glecs":{"main_menu":"Main Menu","username":"Username","save_my_username":"Save My User Name","login_title":"Company Login","password":"Back"}}

Riaz
9 Feb 2011, 4:37 PM
I am confused. Which field or fields you want to retrieved?

aonjavadev
10 Feb 2011, 8:49 AM
I want to get the "glecs" field so I can use it like this: glecs.main_menu

really, I can't seem to get anything out of that store because after I call the load method the store still has empty arrays for anything that I can see when I inspect it.