Hi,
The SharePoint "Link to a Document" content type allows you to easily add links into document libraries. The HTML code for a "Link to a Document" looks like this:
<a href="/sites/Nest/V3Training/Onboarding.aspx">Onboarding<img width="1" height="1" border="0" alt="Use SHIFT+ENTER to open the menu (new window)." class="ms-hidden" src="/_layouts/images/blank.gif"/></a>
I have been using the jQuery code below to open these links into a new window.
The code works fine on library views that DO NOT use the grouping feature. It also works fine for views with grouping that initially display ALL Groups EXPANDED.
However, it refuses to work when the library view uses grouping and ALL Groups are COLLAPSED.
The grouping feature in SharePoint uses Javascript functions and I guess it conflicts with the jQuery code somehow. I just can't figure out how!
Any ideas? Thanks!
<script src="http://mysp/sites/Nest/JQuery/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$('a[onclick*=SharePoint.Link]').attr('target','_blank');
var test = $('a[onclick*=SharePoint.Link]');
alert(test);
});
</script>