I have a created a list via the Promoted List chart which contains the LinkLocation as the URL for the specific file. When viewing the list in the TILE view, it opens the links in modal box but when changing to normal chart view > the link opens in a new browser.
I have used the following suggestions but did not manage to get it working: how to open hyperlink list item in modal dialog box
Field=LinkLocation << is the URL field's name in ListSettings
Java Script used:
<script type="text/javascript">
var links=getElementByLinkLocation("a","LinkLocation");
var origin=links;
var temp="javascript:OpenPopUpPage('" + origin + "', null, 640, 480)";
links.href=temp;
function getElementByLinkLocation(tagName,elementTitle){
var elementTag;
var els=document.getElementsByTagName(tagName);
var elsLen=els.length;
var pattern=new RegExp("(^|\\s)" + elementTitle + "(\\s|$)");
for (var i=j=0; i < els.length; i++){
if (elementTitle.toUpperCase()==els[i].title.toUpperCase()){
elementTag=els[i];
j++;
}}
return elementTag;
}
</script>
Anyone who can recommend me another method, please?
viewattribute and past it complete value in the above code i.e. in above code replace betweenview="and"]– ThinkB4Code Sep 14 '17 at 09:42