Ramco Ramco

Ramco Ramco

  • 459
  • 2.8k
  • 400.9k

How Jquery Datatable Showing ENtries will get updated

Jun 2 2021 9:12 AM
Hi
 
   WIth the belw code row gets deleted . 
Line - Showing 1-8 of 8 this value does not get updated
 
function Delete() {
var Id = $("#hiddenId").val().replace(/\r?\n|\r/g, "").trim();
$.ajax({
url: "/Location/Delete",
data: { Id: Id },
type: "POST",
dataType: "json",
success: function (result) {
//$("#row_" + Id).remove();
$('#DeleteModal').modal('hide');
},
error: function (errormessage) {
alert(errormessage.responseText);
}
});
}
*******
<table table table-striped table-bordered" style="width:100%" id="tblLocation">
<thead>
<tr>
<th>
@Html.DisplayNameFor(model => model.Id)
</th>
<th>
@Html.DisplayNameFor(model => model.Description)
</th>
<th>
@Html.DisplayNameFor(model => model.IsActive)
</th>
<th>Action</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<td>
@Html.DisplayFor(modelItem => item.Id)
</td>
<td>
@Html.DisplayFor(modelItem => item.Description)
</td>
<td>
@Html.DisplayFor(modelItem => item.IsActive)
</td>
<td>
<a class='btn btn-primary btn-sm' id='btnEdit'><i class='fa fa-pencil'></i> Edit</a>
<a class='btn btn-danger btn-sm' id='btnDelete' style='margin-left:5px'
@{ if(item.IsActive == "N")
{
@:disabled="disabled"
}
}><i class='fa fa-trash'></i> Delete</a>
@*<a class='btn btn-danger btn-sm' id='btnDelete' style='margin-left:5px'><i class='fa fa-trash'></i> Delete</a>*@
</td>
</tr>
}
</tbody>
</table>
 

Answers (1)