Hi,
I have a json data thats look like this...
{"totalCount":1,"data":[{"cpa_cp_id":"8884","cpa_service_id":"DG_EXPRESSO_SMS"]}And I have ext code that load the data into store and to access the record in store..
Ext.onReady(function(){
var propStore = new Ext.data.JsonStore({
url: '/sdp/test/serviceDetail.jsp',
root: 'data',
id: 'cpa_service_id',
fields: [ open3dgis : Messages : 11-40 of 121:: Hi Mauricio, Hmm, sorry for my probably bad understading to english. from postgis extension(and thats why we compile postgis) and then it stores the http://tech.groups.yahoo.com/group/open3dgis/messages/11HOME |
{name: 'cpa_cp_id'},
{name: 'cpa_service_id'}
]
});
propStore.load();
alert(propStore.getAt(0).data);
});however, it return javascript error ... Blake List Archive -- Albion.com:: know that they had great difficulty understading what Blake was referring to and Such a title should indicate why Prof. Altizers work has so influenced me. http://www.albion.com/blake/archive/volume1997/11.htmlHOME |
propStore.getAt(0) is undefined
Why I cant access getAt(0) ?. From the firebug, the url has been fetched and received json data.
Store loading is asynchronous. That means once you tell your store to load, it has to make a request to another source for the page. While it's doing that, your code keeps on running. By the time you're trying to get the first record, your store probably hasn't loaded yet.
myStore.on('load', function()
{
var rec = myStore.getAt(0);
}
);
myStore.load();
How much does getting a small tattoo on your hip/stomach hurt?
Do anyone else have an itchy anus? ?
|