DataTable not rendering - 'aDataSort' is null or not an object ERROR
DataTable not rendering - 'aDataSort' is null or not an object ERROR
![ilatine](https://secure.gravatar.com/avatar/86d579c592dde72796968cfc6506d5f4/?default=https%3A%2F%2Fvanillicon.com%2F86d579c592dde72796968cfc6506d5f4_200.png&rating=g&size=120)
I have a sharepoint site in which I add the contents of my list to an array. I then json.stringify my array and then pass it to the Ajax renderer but I get the error: 'aDataSort' is null or not an object ERROR. Below are snippets of my code:
var myJsonArray = [];
var myJSON = "";
$.getJSON("../practice/_vti_bin/ListData.svc/TicketingSystems",function(data) {
//iterate through all returned Ticket list items and get count
$.each(data.d.results, function(i,result) {
//get item property
var jsonTick = {};
jsonTick.Title = result.Title;
jsonTick.ReceivedDate = result.ReceivedDate;
jsonTick.ResolutionDate = result.ResolutionDate;
jsonTick.CommunicationType = result.CommunicationType;
jsonTick.TicketType = result.TicketType;
jsonTick.TicketOpen = result.TicketOpen;
jsonTick.EndOfWeek = result.EndOfWeek;
myJsonArray[i] = jsonTick;
i++;
});
myJson = JSON.stringify(myJsonArray);
console.log("Json: "+myJson);
});//getJSON
Elsewhere in the code the function is called.
function callDataTable()
{
$('#chart2').dataTable( { "ajax": myJson, "deferRender": true } );
}
<Table id="chart2" class="display"></Table>
Any help would be greatly appreciated. Thanks!
This discussion has been closed.