DataTable not rendering - 'aDataSort' is null or not an object ERROR

DataTable not rendering - 'aDataSort' is null or not an object ERROR

ilatineilatine Posts: 20Questions: 2Answers: 0
edited August 2014 in Free community support

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;  
    myJson = JSON.stringify(myJsonArray); 
    console.log("Json: "+myJson);

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.