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.8k
DataTable row not getting removed
Jun 2 2021 7:04 AM
Hi
Record in Database is getting deleted but row is not getting removed from table
$("#row_" + Id).remove(); is not working.
public JsonResult Delete(string ID)
{
dbLocation.Delete(ID);
return Json(new { success = true, message = "Saved Successfully" });
}
function Delete() {
var Id = $("#hiddenId").val().replace(/\r?\n|\r/g, "");
Id = Id.trim();
$.ajax({
url: "/Location/Delete",
data: { Id: Id },
type: "POST",
//contentType: "application/json;charset=utf-8",
dataType: "json",
success: function (result) {
$("#row_" + Id).remove();
$('#DeleteModal').modal('hide');
clearTextBox();
$.notify(result.message, {
globalposition: "top center",
className: "success"
})
},
error: function (errormessage) {
alert(errormessage.responseText);
}
});
}
*********************************************
@foreach (var item in Model)
{
@Html.DisplayFor(modelItem => item.Id)
@Html.DisplayFor(modelItem => item.Description)
@Html.DisplayFor(modelItem => item.IsActive)
Edit
@{ if(item.IsActive == "N")
{
@:disabled="disabled"
}
}>
Delete
}
*******************************
$(document).ready(function () {
$("#tblLocation").dataTable({
});
Thanks
Reply
Answers (
5
)
Login User data comes from Database
How Jquery Datatable Showing ENtries will get updated