Open a file preview

Hi, is it possible to open a preview of file (image) in dialog from List or Library control?

WF

Dear @wflorczyk,
Clicking on the file name opens image in a new tab by default. How do you see the dialog working differently?

Inside dialog. I imagine that I use an image control with url to file which is easily to retrieve from arguments of parent window

WF

Dear @wflorczyk,
The dialog is only used for opening a form... You can try to open a form, which will contain the Image preview. For example, using the Image control.

This what I mean. I would like to click on a file name or an icon on the left and open a form in dialog, but it will be form when I load image or iframe. Sound complicated but i would like to copy "preview" functionality from default vie of sharepoint library.

WF

Dear @wflorczyk,
You can customize one of the columns so that the link opens Edit/Display form of the edited document, like we discuss in the other topic.

To make a preview appear on the Edit/Display form, add Name field and an Image control and the following JavaScript code:

fd.spRendered(function(){
  fd.control('Image1').source = fd.field('FileLeafRef').value.FileUrl;
});
1 Like