Note that there are some explanatory texts on larger screens.

plurals
  1. POcreate record for nested json element
    text
    copied!<p>I have following json data now i want to create a record based on this rite now i have following structure to create record but i don;t know how would i put the CONTACT_INFO as a nested element </p> <p>Note: i am directly reading values from GRID ( but from a grid i am not getting nested element CONTACT_INFO and then want to create record )</p> <p><em><strong>RECORD</em></strong></p> <pre><code>var record= Ext.data.Record.create([ { name: 'CANDI_SR_NO'}, { name: 'CANDI_NAME'}, { name: 'CANDI_CASTE_BAR'}, { name: 'CANDI_IS_NRI'}, { name: 'CANDI_CASTE'}, { name: 'CANDI_SUB_CASTE'}, { name: 'CANDI_STATUS'}, { name: 'CANDI_AGE'}, { name: 'CANDI_HEIGHT'}, { name: 'CANDI_NATIVE_PLACE'}, { name: 'CANDI_EDUCATION'}, { name: 'CANDI_DESIGNATION'}, { name: 'CANDI_COMPANY'}, { name: 'CANDI_EMAIL_1'}, { name: 'CANDI_EMAIL_2'}, { name: 'CANDI_EMAIL_3'}, { name: 'CON_L_1'}, { name: 'CON_L_2'}, { name: 'CON_L_3'}, { name: 'CON_M_1'}, { name: 'CON_M_2'}, { name: 'CON_M_3'}, { name: 'CANDI_SALARY'}, { name: 'CANDI_COMMENT'}, ]); </code></pre> <p><em><strong>JSON</em></strong></p> <pre><code>[ { "CANDI_SR_NO": "12", "CANDI_NAME": "XYZ", "CANDI_CASTE_BAR": false, "CANDI_IS_NRI": "false", "CANDI_CASTE": "RAS", "CANDI_SUB_CASTE": "", "CANDI_STATUS": "", "CANDI_AGE": "", "CANDI_NATIVE_PLACE": "", "CANDI_EDUCATION": "", "CANDI_DESIGNATION": "", "CANDI_COMPANY": "", "CONTACT_INFO": { "CANDI_EMAIL_1": "asdf", "CANDI_EMAIL_2": "", "CANDI_EMAIL_3": "", "CON_L_1": "asdf", "CON_L_2": "", "CON_L_3": "", "CON_M_1": "", "CON_M_2": "", "CON_M_3": "" } , "CANDI_SALARY": "", "CANDI_COMMENT": "" } ] </code></pre> <p>I want to send a data in a json format as above but once i click on submit button of a form. so i am asking how to create a Record in extjs so that i can send nested element inside json</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload