js link - open document in browser
-
11-01-2021 - |
Question
I`v made a neat JS link and implied it to a document library that adds a image to a document that that have the archive field on "yes".
the problem is that now the office documents doesn’t open via web (office web access).
=== this is the code that overriide and send the link to the documents ===
return "<a style = 'color: black; text-decoration:none' href='" + url + "'>" + ctx.CurrentItem.FileLeafRef + " <img src='http://portalaviv/planning/Style%20Library/archivesign.png' alt='Archive Document' title='Archive Document'/></a>";
}
else {
return "<a style = 'color: black; text-decoration:none' href='" + url + "'>" + ctx.CurrentItem.FileLeafRef + "</a>";
It worked return "" + ctx.CurrentItem.FileLeafRef + "";
Solution
Add a query Parameter to the url
ctx.CurrentItem.FileLeafRef + "?web=1"
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange