To expand on what Kamal Deep Singh talked about:
You can dynamically create a table on the fly, and then apply data to it to get the functionality of the data.
<table id="myDatatable" class="... whatever you need..."></table>
and then:
var newTable = '<thead><tr>';
$.ajax( {
url: "http://my.data.source.com",
data: {},
success: function(data) {
$.each(data[0], function(key, value) {
newTable += "<th>" + key + "</th>";
});
newTable += "</tr></thead><tbody>";
$.each(data, function(key, row) {
newTable += "<tr>";
$.each(row, function(key, fieldValue) {
newTable += "<td>" + fieldValue + "</td>";
});
newTable += "</tr>";
});
newTable += '<tbody>';
$('#myDatatable').html(newTable);
}
});
$('#myDatatable').dataTable();
Please note that you can put parameters into this .dataTable () as usual, but not 'sAjaxSource' or any of the functions for receiving data associated with it - this is applying data to an existing table that we created on the fly.
, , .
. . : https://github.com/DataTables/DataTables/issues/273