I tried that table automatically refresh but it does not until I manually reload the whole page.
When I delete data this exception occur in console on .draw();
Uncaught TypeError: $(...).draw is not a function at sortTableAfterdelete
function ConfirmDelteTraining(id) {
$.post("/Franchise/deleteTraining", { TrainingId: id }, function (data) {
if (data) {
debugger;
var t = $('#trainingGrid').DataTable();
t.row($('#trainingGrid').find('[data-id=' + id + ']')).remove().draw();
//Set order after deleting state
sortTableAfterdelete();
}
function sortTableAfterdelete() {
if ($("#trainingGrid tbody tr td").length == 1) {
$('#trainingGrid').DataTable().search(this.value).draw();
}
};