TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ramco Ramco
441
3.4k
522.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)
{
<tr
[email protected]
>
<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>
Reply
Answers (
1
)
DataTable row not getting removed
Refresh DataTable after Add