My Json Object is like this :
[{
"attributes": {
"Code": "SGL",
"Total": "19421340.27"
},
"DayPrice": [{
"Date": "2016-07-22",
"Rate": "4900439.85"
}, {
"Date": "2016-07-23",
"Rate": "4845150.21"
}, {
"Date": "2016-07-24",
"Rate": "4845150.21"
}, {
"Date": "2016-07-25",
"Rate": "4830600"
}]
}, {
"attributes": {
"Code": "DBL",
"Total": "6473780.09"
},
"DayPrice": [{
"Date": "2016-07-22",
"Rate": "1633479.95"
}, {
"Date": "2016-07-23",
"Rate": "1615050.07"
}, {
"Date": "2016-07-24",
"Rate": "1615050.07"
}, {
"Date": "2016-07-25",
"Rate": "1610200"
}]
}, {
"attributes": {
"Code": "QUAD",
"Total": "6473780.09"
},
"DayPrice": [{
"Date": "2016-07-22",
"Rate": "1633479.95"
}, {
"Date": "2016-07-23",
"Rate": "1615050.07"
}, {
"Date": "2016-07-24",
"Rate": "1615050.07"
}, {
"Date": "2016-07-25",
"Rate": "1610200"
}]
}]
From the json object array, I want display like this image:
I had try it, but I'm still confused. I feel it can not be done.
I try loop in loop like this :
countRoomType = json_object.length;
for(var i=0; i<countRoomType; i++){
countDayPrice = json_object[i].DayPrice.length;
for(var j=0; j<countDayPrice; j++){
...
}
}
Any solution to solve my problem?
