-
9 Oct 2011 4:27 AM #1
Answered: jsonreader: how to get the totalProperty from a nested JSon value?
Answered: jsonreader: how to get the totalProperty from a nested JSon value?
Hi,
How can I define the totalProperty config value of my Jsonreader to use a value from my JSon response that is nested a few levels down? If you look at the JSON response below, I need the totalProperty value to be taken from queries/request/totalResults...
JSON response:
{
"queries": {
"request": [{
"totalResults": "87200"
}]
},
"items": [
{"title": "The title"},
{"title": "The title"}
]
}
Thanks in advance,
James
-
Best Answer Posted by jamesnpope
Found it...

totalProperty: 'queries.request[0].totalResults'
-
9 Oct 2011 4:29 AM #2
[SOLVED]
[SOLVED]
Found it...

totalProperty: 'queries.request[0].totalResults'
-
9 Oct 2011 4:51 AM #3Sencha - Ext JS Dev Team
- Join Date
- Apr 2007
- Location
- Sydney, Australia
- Posts
- 15,242
- Vote Rating
- 106
- Answers
- 187
That works. For more complicated stuff a function would work too.
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!


Reply With Quote