Ifyou create a lookup column in a SharePoint list, the link on the DataView will open the linked item in a modal popup. This page explains how to open it in a new page.
This article comes from this forum thread: SharePoint 2010 - Change lookup hyperlink to open in same window.
We will use a little bit of JavaScript, which will change the rendering code of the DataView.
1. SharePoint 2010 (Server or Foundation) 2. SharePoint Designer 2010 3. A created list with a lookup column, and at least one item in this list 4. 5 minutes to do this
- Download jQuery on the official website : http://jquery.com/ - Upload it in a folder or in a document Library - Copy and paste its URL to the notepad
6. Near the end of the page, find this piece of code :
<style type="text/css">
<style type=
"text/css"
>
.ms-bodyareaframe {
padding: 0px;
}
</style>
<script type="text/javascript" src="the/path/you/paste/jquery.js"></script> <script type="text/javascript"> $(document).ready(function() { $("td[class='ms-vb2'] a").each(function() { $(this).attr("onclick",""); }); }); </script>
<script type=
"text/javascript"
src=
"the/path/you/paste/jquery.js"
></script>
$(document).ready(
function
() {
$(
"td[class='ms-vb2'] a"
).each(
this
).attr(
"onclick"
,
""
);
});
</script>