I have some sort of
[
{
"selectionId":1,
"selectionDate":"101662",
"selectedBy":"ABC",
"eximPanNo":222,
"eximPanName":"DEF",
"eximPanNameEng":"KKK",
"eximPanAddress":null,
"eximPanAddressEng":null,
"eximPanPhone":12334566,
"selectionType":"G",
"consignmentNo":0,
"consignmentDate":"2098",
"productName":"LLL",
"selectionFromDate":"2019",
"selectionToDate":"2090",
"agentNo":123,
"selectionStatus":"I",
"entryBy":"PCS",
"entryDate":"2018-11-22 11:46:02",
"rStatus":"F",
"custOfficeId":1,
"selectionAudit":[
{
"audGrpId":1,
"selectionId":1,
"assignFromDate":"2075-08-03",
"assignToDate":"2075-08-19",
"entryBy":"1",
"rStatus":"1"
}
]
}
]
How can i show this selectionAudi.audGrpId data in dataTable when called from AJAX?
Here the Api is called through AJAX.
var table = $('#nepal').DataTable({
"processing" : true,
"ajax" : {
"url" : A_PAGE_CONTEXT_PATH + "/form/api/getAllSelectionAudit/all",
dataSrc : ''
},
"columns" : [ {
"data" : "selectionId"
}, {
"data" : "selectionDate"
}, {
"data" : "selectedBy"
}, {
"data" : "eximPanNo"
} ]
});
But when I add "data":"selectionAudi.audGrpId" then the datatable shows error like :

The code for table is:
<table id="nepal" class="table table-bodered">
<thead>
<tr>
<th>Selection No</th>
<th>SelectionDate</th>
<th>SelectedBy</th>
<th>PanEximNumber</th>
<th>AudiGroupID</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
How can i show the inner Json data into datatable?I am not able to see what is the real solution.
selectionAuditis anarraywith oneobjectthat has theaudGrpIdproperty, so you needselectionAudi[0].audGrpIdto access the property.rendercallback, using thedataorrowargument and checking whetherselectionAuditexists in your object. Check this for reference: datatables.net/reference/option/columns.render