View Full Version : Issue with loading form panel with nested json response

14 Jan 2012, 2:19 PM
Need your help. I m new to ExtJs, i m unable to load fields like person.address.city into extjs. I can see fields like recordNumber gets loaded with out issue. Could you please tell me what needs to be done.

{"data":{"recordNumber":2121211,"depositoryName":"John Doe","ourAccount":true,"b
ankAccountDetailList":[{"nameIfNtBorrwer":"TESTER - 1","bankAccountDetailsID":1,
orrwer":"TESTER - 2","bankAccountDetailsID":2,"balence":10000.0,"bankAccountNum"
:2000,"bankAccountType":"Saving"}],"id":1,"address":{"street":"1898 S Clinton St

function fnLoadForm(theForm)

url: 'loadbankaccount.html',

headers: {Accept: 'application/json, text/javascript, */*; q=0.01'},

waitMsg: 'loading...',

params : {

id: 1


} //end

15 Jan 2012, 2:18 PM
Ext JS 3 or 4?

17 Jan 2012, 7:35 AM
I m using extjs 4, please help me. Thx

17 Jan 2012, 7:36 AM
I have moved this thread to the appropriate forum, Ext JS 4 Q&A forum. Please post in the appropriate forum and wrap your code in code tags.

17 Jan 2012, 7:48 AM
A form's load() method isn't intended for loading nested data structures. Basically, there should be a one-to-one correspondence between each component in your form and each item in the data attribute of the JSON.

You can manually extract the nested data bits and set values on specific components in the success method of the form load:

url: 'employee/get',
params: {
employeeId: 1
success: function(basicForm, action) {
failure: function(basicForm, action) {
// do somethng on failure.