PDA

View Full Version : Ext.data.JsonStore how to get data not from "root"



kshvakov
15 Oct 2010, 6:51 AM
Ext.apply(this, {
store : new Ext.data.JsonStore({
url : '/json-test/photo.json.php',
autoLoad : true,
root : 'images',
totalProperty : 'totalCount',
id : 'id',
fields : [
'id', 'name', 'url'
]
})
})

/photo.json.php


{
"success":true,
"albumName" : "Album",
"description" : "desc",
"totalCount":250,
"images":[
{"id":1,"name":"Image","url":"\/img\/1.jpg"},
{"id":2,"name":"Image2","url":"\/img\/2.jpg"}
]
}

How to get "albumName" and "description" on load data ?

heidtmare
15 Oct 2010, 7:31 AM
listeners:{
load:function(store){
var ab = store.jsonData.albumName;
var de = store.jsonData.description;
}
}

kshvakov
15 Oct 2010, 11:13 PM
thanks