Why Join
Become a member
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
C# Corner Home
Technologies
MonthlyLeaders
ASK A QUESTION
Forumguidelines
Sushant Torankar
1.7k
324
7.6k
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