After making a POST request using AJAX I get the following JSON response:
{
\"ServiceName\": \"ABC\",
\"Response\": {
\"Object\": [
{
You must iterate over the response and convert it into a format dataTables can comprehend. As I read the sample data you have an Object
holding blocks of Attributes
holding an Attribute
with key => value pairs as AttributeName
=> AttributeValue
. So parse the response in a dataSrc
callback :
var table = $("#example").DataTable({
ajax : {
url : 'nestedData.json',
dataSrc : function(json) {
var temp, item, data = [];
for (var i=0;i
the dataSrc
callback return an array of objects on the form :
data = [
{ Code: "576", Country: "Americas", Name: "XYZ", Place: "Abc" },
{ Code: "536", Country: "India", Name: "XYZHJ", Place: "Abchgh" }
]