When you create a data table, assign the resulting value to a variable:
var table = $(".something").dataTable();
When you create your new element, presumably through AJAX, be sure to return the properties that your table should display. Then in your success function, you can use the fnAddData method to add a new row to your table. This method takes an array of values, the first in the first column, the second in the second, etc .:
success: function(response){ table.fnAddData([ response.id, response.name, response.description, ]); }
Read more about the fnAddData method here .
Mike trpcic
source share