Nested JSON To Datatable

Posted by Ravimakhija88 under ASP.NET on 5/5/2015 | Points: 10 | Views : 981 | Status : [Member] | Replies : 1
Hello,

I want to convert below json to datatable, for that i can create classes but for room types which have another object about room details how to do that part ? room types i.e standard room, executive are dynamic

{
"city":"Bengaluru",
"country":"India",
"start_date":"2015-05-23",
"end_date":"2015-05-25",
"party":[
{
"adults":2
}
],
"num_hotels":1,
"hotels":[
{
"hotel_id":"2210648",
"name":"Fortune Select JP Cosmos",
"street":"No 49 Cunningham Crescent Road Behind Sigma Mall",
"city":"Bengaluru",
"postal_code":"560044",
"state":"Karnataka",
"country":"India",
"latitude":12.98971,
"longitude":77.59463,
"phone":"91 (20) 65008171",
"room_types":{
"Standard Room":{
"price":13136.200000,
"fees":0,
"fees_at_checkout":0,
"taxes":0,
"taxes_at_checkout":0,
"final_price":13136.200000,
"currency":"INR",
"num_rooms":1
},
"Executive Room":{
"price":10771.684000,
"fees":0,
"fees_at_checkout":0,
"taxes":0,
"taxes_at_checkout":0,
"final_price":10771.684000,
"currency":"INR",
"num_rooms":1
}}}
]}





Responses

Posted by: Jayakumars on: 5/8/2015 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Hi
Ravi

Refer this urls

https://editor.datatables.net/examples/advanced/deepObjects.html
https://www.datatables.net/examples/data_sources/ajax.html
http://www.jqueryajaxphp.com/jquery-datatable-using-json/

Mark as Answer if its helpful to you

Ravimakhija88, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response