View Full Version : [SOLVED] Nested JSon for FormPanel

6 Oct 2010, 5:47 AM
Hi all.

So i know this has been an issue on the forums before and I have searched and tried out the solutions posted, but I can't seem to get my nested JSON to populate any of my FormPanel fields.

I have the following JSON returned:

"primaryContact":"Raj Patel",

And my JSON Reader:

var reader = new Ext.data.JsonReader({
successProperty: 'success',
root: 'data',
fields: [
{name:'name', type: 'string', mapping:'Company.name'},
{name:'fisrtName', type: 'string', mapping:'PDUser.firstName'}

My field names in the form are 'name' and 'firstName'.

This isn't working for me.

Any ideas?


6 Oct 2010, 5:52 AM
A JsonReader expects the root to be an array. Either fix your data or use:

root: function(v){
return [v.data];

6 Oct 2010, 5:23 PM
Awesome thanks!!!

That did it :)