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
Guest User
Tech Writer
611
127.9k
Delete Data click button.
Mar 24 2020 2:46 AM
jquery datatable delete records click button. Not select full row. only button click.
<script>
$(document).ready(
function
() {
var
tableTeam = $(
'#tblteam'
).DataTable();
tableTeam.row().remove().draw(
false
);
});
</script>
$(
"#tblteam"
).on(
'click'
,
'.btndelete'
,
function
(e) {
var
ab = $(
this
).closest(
"tr"
);
var
tableTeam = $(
'#tblteam'
).DataTable();
var
row =
this
.closest(
'tr'
);
ab.remove();
var
FavId = $(
this
).attr(
"data-Id"
)
var
type = $(
this
).attr(
"data-Name"
)
//var FavId = $(this).parent().attr("data-Id")
//alert(FavId);
$.ajax({
url:
'/FavouriteManagement/Delete?id='
+ FavId,
type:
'POST'
,
data: {
"FavId"
: FavId,
"Type"
: type },
async:
false
,
success:
function
(data) {
if
(data.status ==
true
) {
$(
this
).closest(
'tr'
).remove();
tableTeam.row(row).remove().draw(
false
);
}
else
{
alert(
"Something went wrong"
);
return
false
;
}
},
error:
function
(data) {
//alert('Problem in deleting user:' + data.responseText);
}
});
});
This is my code Please solve.
Reply
Answers (
1
)
Geo Location Fields Format Validation
Function return JSON value but not display in Grid