Complex JSON format
Complex JSON format

We want table header and table body data dynamic for object CustomerDetails.
{
"data": [
{
"LoanType":"Personal",
"LoanDetails":{
"item1":"316784",
"item2":"0",
"item3":"15",
"item4":"12EMI"
},
"CustomerDetails":{
"item1":"asdasd ",
"item2":"sdadasd dadasd"
},
"EMISchedule":[{
"EMICalDueDate":"6/02/2019",
"EMICalPrinciple":"11197.99",
"EMICalIntrest":"1582",
"EMICalRepayAmount":""
},
{
"EMICalDueDate":"6/03/2019",
"EMICalPrinciple":"11458.08",
"EMICalIntrest":"1322",
"EMICalRepayAmount":""
}
]
}, {
"LoanType":"Personal",
"LoanDetails":{
"item1":"316784",
"item2":"0",
"item3":"15",
"item4":"12EMI"
},
"CustomerDetails":{
"item1":"asdasd ",
"item2":"sdadasd dadasd"
},
"EMISchedule":[{
"EMICalDueDate":"6/02/2019",
"EMICalPrinciple":"11197.99",
"EMICalIntrest":"1582",
"EMICalRepayAmount":""
},
{
"EMICalDueDate":"6/03/2019",
"EMICalPrinciple":"11458.08",
"EMICalIntrest":"1322",
"EMICalRepayAmount":""
}
]
}
]
}
Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
This discussion has been closed.
Replies
This example shows how to use complex Ajax objects:
https://datatables.net/examples/ajax/deep.html
If you want to build dynamic column headers you will need to do this before Datatables initialization. Here is an example:
http://live.datatables.net/huyexejo/1/edit
Kevin