AJax.Reload returning invalid Json when the Json is valid.

AJax.Reload returning invalid Json when the Json is valid.

pricejtpricejt Posts: 12Questions: 5Answers: 1
edited March 2016 in DataTables 1.10

When my datatable is first created i call a function GetJsonData()
var jsonData = GetJsonData();

When i initiate the datatable my data field looks like this.
"data": JSON.parse(jsonData).data

GetJsonData makes an ajax call and returns my json array. This works fine.

When i want to reload the table i have another function called reloadTable

function reloadTable() {
        var table = $('#tblCases').DataTable();
        var jsonData = JSON.parse(GetJsonData()).data;
        table.ajax.reload(jsonData);
    }

you can see this function calls the same function GetJsonData which works on the initial load.
I checked the json that is being returned and json lint says its valid. I can post the json object if needed.
Is there something else i am doing wrong?

Here is an example. It isn't throwing the same errors, but its also not working. If you click on the button to reload the table it throws errors in the console.

http://live.datatables.net/zibohaji/5/edit?html,css,js,output

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.