Is it possible to access a div element with jQuery? I need to write a costum jQuery function
for a "onClick" event in my Report. Within the div I have a picture and when the user clicks
on it, I want to pop-up a window to display the photo.
Screenshot: http://i44.tinypic.com/ok9y5e.jpg
Thanks!
3 Answers, 1 is accepted
0
Steve
Telerik team
answered on 06 Feb 2012, 11:04 AM
Hello Margret,
You can set a Hyperlink Action to the PictureBox item that would open another window with the full size image.
All the best,
Steve
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Thank you for the answer. But I need to open the picture in a jQuery dialog, so I need acccess to the DIV element or is it possible to override the Hyperlink Action so I could use it for my purpose?
Best regards.
0
Steve
Telerik team
answered on 06 Feb 2012, 02:00 PM
Hi Margret,
You cannot override the Hyperlink action. You can however hook up to the OnReportLoaded event of the viewer and do what you need there.
ReportViewer.prototype.OnReportLoaded = function () {
this.OnReportLoadedOld();
var reportFrame = document.getElementById(this.reportFrameID);
var reportDocument = reportFrame.contentWindow.document;
var body = reportDocument.getElementsByTagName("body")[0];
//find the div and do what you need
}
</script>
Note however that in your particular scenario, you want to use the report to "post" some kind of "commands" for your application that are not valid from outside the application. We would suggest extracting these actions from the reports to the application as this way the reports will contain only the relevant information and will be really portable - that is you can export them to PDF or Excel and can open them outside your application.
Regards,
Steve
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>