ravi sharma

ravi sharma

  • NA
  • 87
  • 16.6k

Reload jquery datatable page with statemanagement

Jul 26 2018 5:49 AM
Hi,
 
I have 22 records in jquery datatable grid. There is a pagination of 10. I have removed one row. so page no shoud  be 3. Now i remove one more record from page no 3. In this case, page no should be 2. I am not able to do so. Following is my code. Please suggest.
 
$(document).on('click', '.lnkDelete', function () {
var itemid = $(this).data('id');
$.ajax({
url: "/Gallery/Delete",
type: "POST",
data: { 'Id': itemid },
dataType: "json",
success: function (data) {
$('#dataTables-gallery').DataTable().ajax.reload();
}
});
});

Answers (1)