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
515
46k
Regarding addEventListener event
Mar 6 2019 1:13 AM
I am using the addEventListener event on one of the buttons in MVC datatable. (I am using that button to Show image in popup corresponding to that row).
So when I clicked on that button in first row in datatable, it works fine. But as I go to the same button on a diferent row, it does not do anything.
Maybe multiple addEventListener is not working.
So need help in this.
Kindly Thank you in advance.
Following is code snippet :
document.getElementById(
"buttonopenimage"
).addEventListener(
"click"
, ShowSnapOnHistory,
false
);
function
ShowSnapOnHistory()
{
alert($(
"#hdnFlag"
).val());
$.ajax({
url:
'@Url.Action("ShowReceiptImageInPopup", "Transaction")'
,
type:
'GET'
,
data: { Id: $(
"#hdnFlag"
).val() },
dataType:
'json'
,
success:
function
(result) {
var
image =
new
Image();
image.src =
'https://api.shoppercoin.io/UploadedFiles/'
+ result.reclist.ReceiptName;
// $('#imgReceipt').attr('src', 'https://api.shoppercoin.io/UploadedFiles/' + result.reclist.ReceiptName);
var
viewer =
new
Viewer(image,
{
hidden:
function
() {
viewer.destroy();
},
});
// image.click();
viewer.show();
}
});
}
Reply
Answers (
3
)
Calender extender in ajax control toolkit
More then one element exception