Unable to reload data to a DataTable with additional information from a new nurl

I am using the DataTable plugin.

I am loading the DataTable. Then I am attempting to reload the table, while preserving the existing content, with additional information acquired from another json file. However, there is no reload occurring.

var resourcetable = $('#table').DataTable({
"ajax": {
    "url": "QueryDataService.asmx/GetData1",
    "dataSrc": ""
},
"columns": [
    { "data": "Column1" },
    { "data": "Column2" },
    { "data": "Column3" }                ]
});

resourcetable.ajax.url("QueryDataService.asmx/GetData2").reload();

The error I see is: Uncaught TypeError: resourceusagetable.ajax.url(...).reload is not a function

Appreciate your help.

Thank you.

Answers 1

  • reload() is callable from ajax, not url(). load() is callable from url(), so i would try resourcetable.ajax.url("QueryDataService.asmx/GetData2").load();


Related Articles