PDA

View Full Version : model for JSON with multiple roots



veerakishorekallam
19 Mar 2012, 12:36 AM
my JSON structure is as below

{
"compareVO": [
{
"msrp": "msrp1",
"engine": "engine1",
"primaryColor": "PrimaryColor1",
"peg": "peg1",
"transmission": "transmission1",
"trim": "trim1",
"model": "model1",
"vin": "vin1"
},
{
"msrp": "msrp2",
"engine": "engine2",
"primaryColor": "PrimaryColor2",
"peg": "peg2",
"transmission": "transmission2",
"trim": "trim2",
"model": "model2",
"vin": "vin2"
},
{
"msrp": "msrp3",
"engine": "engine3",
"primaryColor": "PrimaryColor3",
"peg": "peg3",
"transmission": "transmission3",
"trim": "trim3",
"model": "model3",
"vin": "vin3"
}
],
"options": [
{
"optionType": "same",
"optionName": "option1",
"value1": "o1value1",
"value2": "o1value2",
"value3": "o1value3",
"value4": "o1value4"
},
{
"optionType": "same",
"optionName": "option2",
"value1": "o2value1",
"value2": "o2value2",
"value3": "o2value3",
"value4": "o2value4"
},
{
"optionType": "same",
"optionName": "option3",
"value1": "o3value1",
"value2": "o3value2",
"value3": "o3value3",
"value4": "o3value4"
},
{
"optionType": "same",
"optionName": "option4",
"value1": "o4value1",
"value2": "o4value2",
"value3": "o4value3",
"value4": "o4value4"
}
]
}
The above json has 2 roots compareVO, options. could anybody help me how to frame Model for the above json with mulitple roots


for ffor the

voodoov
19 Mar 2012, 1:18 AM
Hi,

Take a look at this, maybe it helps you out:
http://stackoverflow.com/questions/9321011/how-to-create-multiple-rooted-json-for-extjs-store