Each row in the data table has a delete button.
When I click the delete button, I call this code:
$('.deleteButton').live('click', function () {
var $this = $(this);
var url = $this.attr("id");
$("#example").fnReloadAjax();
$.getJSON(url, Success());
});
A URL is a controller action that accepts an identifier and deletes data from a database. It works. Now I want to call the refresh / redraw datatable function so that it can load new results, but it does not work.
Datatable:
$("#example").dataTable({
"aoColumns": [
{ "sTitle": "Id" },
{ "sTitle": "Name" }],
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": '@Url.Action("FetchData", "Home")',
"sPaginationType": "full_numbers",
});
Can anyone advise?
source
share