Open related documents in new tab
Hæhæ,
In the display and edit form I need to be able to click the related documents and open them in a new tab (or new window) in the browser. Because the user needs to be able to have the form and the doucment open at the same time.
By default when I am in display/edit form, when I click the related documents they will open in the same window - and I can't find anything about this in the forum :/
Regards
In the display and edit form I need to be able to click the related documents and open them in a new tab (or new window) in the browser. Because the user needs to be able to have the form and the doucment open at the same time.
By default when I am in display/edit form, when I click the related documents they will open in the same window - and I can't find anything about this in the forum :/
Regards
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
Dear Oz,
This shouldn't be the case - by default all items in Related Items are opened in dialog mode. Which version of SharePoint and Forms Designer are you using? Are there any console errors when you open Related Items' form?
Can you, please, provide us some screenshots or even better a video?
This shouldn't be the case - by default all items in Related Items are opened in dialog mode. Which version of SharePoint and Forms Designer are you using? Are there any console errors when you open Related Items' form?
Can you, please, provide us some screenshots or even better a video?
Cheers
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
Dear Oz,
You can try to add the following code to open documents in a new tab:
You can try to add the following code to open documents in a new tab:
Code: Select all
$("a[onclick*='return DispEx'][target!='_blank']")
.attr("target", "_blank")
.removeAttr("onclick");
// document type icons
$("td.ms-vb-icon>img[onclick]:not([documentUrl])")
.click(function (e)
{
window.open($(this).attr("documentUrl"), "_blank");
e.stopPropagation();
e.preventDefault();
return false;
})
.each(function ()
{
$(this).attr(
"documentUrl",
$.trim(String($(this).attr("onclick"))
.split("=")[1]
.replace(/["'{}]/g, "")
.split(";")[0])
);
this.onclick = null;
});
Cheers
-
- Information
-
Who is online
Users browsing this forum: No registered users and 17 guests