Files img preview in Dashboards | XM Community
Skip to main content

Files img preview in Dashboards

  • September 13, 2022
  • 2 replies
  • 23 views

JR33
QPN Level 2 ●●
Forum|alt.badge.img+10
  • QPN Level 2 ●●

Hello,
I'm using a little piece of html for display a preview of the files img uploaded by the survey respondants.
I put this code in a embedded data like that

I was thinking, is there a way to open the img in a new window with personalise size ? (Like a "popup"). I looked around and it seems that need JS or CSS, and it's not possible here.
What do you think ?

2 replies

bgooldfed
Level 4 ●●●●
Forum|alt.badge.img+25
  • Level 4 ●●●●
  • September 14, 2022

Hi JR33,
You will absolutely need JS to do this, it's impossible to make the browser do anything without it.
There is a short guide on adding code to your questions here.
If you want a button to trigger the popup, simply add a Text/Graphic question and add some HTML:

Then you can add JavaScript to the question which tells the button to open a popup:
//bind a popup function to to the button
jQuery("#mybutton").click(function () {
let params = `width=600,height=600`;   //set these to whatever you want
open("${q://QID8/UploadedFileLink}", 'Image Popup', params);
});
Depending on your user's browser settings it might automatically block the popup - so you may need to instruct users on disabling any popup blockers they may have.
Good luck!


JR33
QPN Level 2 ●●
Forum|alt.badge.img+10
  • Author
  • QPN Level 2 ●●
  • September 14, 2022

Yes you totally right but I didn't wanna open a new windows in a survey, but in a dashboard.
So it's truly impossible. That what I thinked about 😪