Supporters of End User
Web

SharePoint 2013: Clicking the icon in Type column is highlighting the item instead of launching the document

Current average rating is 5 stars. Press SHIFT+ENTER to rate this item.1 star selected. Press SHIFT+ENTER to submit. Press TAB to increase rating. Press SHIFT+ESCAPE to leave rating submit mode.2 stars selected. Press SHIFT+ENTER to submit. Press TAB to increase rating. Press SHIFT+TAB to decrease rating. Press SHIFT+ESCAPE to leave rating submit mode.3 stars selected. Press SHIFT+ENTER to submit. Press TAB to increase rating. Press SHIFT+TAB to decrease rating. Press SHIFT+ESCAPE to leave rating submit mode.4 stars selected. Press SHIFT+ENTER to submit. Press TAB to increase rating. Press SHIFT+TAB to decrease rating. Press SHIFT+ESCAPE to leave rating submit mode.5 stars selected. Press SHIFT+ENTER to submit. Press SHIFT+TAB to decrease rating. Press SHIFT+ESCAPE to leave rating submit mode.
Categories:SPF 2013; Document Library; MOSS; WSS; Site Manager/Power User

You may also be interested in: ViewPoint for SharePoint

 

Editor's note: Contributor Chris Grist is a SharePoint Architect at Beach Energy. Follow him @gristdog

If we step back to SharePoint 2007 before Bieber fever, before the first black US president, before 1D and before many hours lost to Angry Birds; we had a field in SharePoint called DocIcon and when you clicked on it, it would open the associated document.

In SharePoint 2010 the field still existed, but was not wrapped in the <a> tag it so needed to function, Microsoft’s response to beta testers was that it was by design and would not be fixed, and even though it still displayed in the view editor as Document Icon (linked to document), it of course was not linked.

In SharePoint 2010, Microsoft, released a kb on a workaround using a .xsl document dropped in the 14 hive see here, and for those a bit less technical several people packaged this up into a deployable WSP to make the process no harder than any other SharePoint change.

Unfortunately in SharePoint 2013, this seems not to work and several people are looking for an answer. It could be as simple as modifying the XSL, but I know 9/10 people do not like looking at XSL2013-04-02-ClickIcon-01.gif.

Therefore, I have put together the below jQuery which you can drop into your master page, to make the icons clickable. The only scenario I could not get it to work was where a view was grouped and collapsed. However, grouped and expanded did work.

You're not going to want to implement this if you have massive amounts of items shown at once, but it may help some of you until (if) Microsoft releases another workaround. Of course if this is just for one document library, you can chuck it in a content editor or html web part to apply to the single page.


<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
    $(".ms-draggable").each(function() {
        var alt = $(this).attr('alt');
        alt = "../" + alt;
        var a = $('<a/>').attr('href', alt);
        $(this).wrap(a);
    });
});
</script>

Comments

Christine

How to edit the xsl?

Thank you for this great article. It is exactly what I was looking for. I would rather edit the xsl than insert code into the master page, but I lack knowledge of the details.
 
What changes do I need to make in the xsl file from the KB article? http://support.microsoft.com/kb/2457975
 

Posted 12-Aug-2013 by Christine
Nathan Muleski

Can't get this to work

I'm not comfortable with editing the Master Pages so I added this to a page as a web part and then also added my document library to the page as web part. When I click on the links it tries to take me to http://site.domain.com/subsite/document.xls instead of http://site.domain.com/subsite/library/document.xls Any idea how to get around this? Or can you provide instructions for how to drop this into the Master Page? Thanks!

Posted 11-Sep-2013 by Nathan Muleski
Bala S Haran

Doesnt seem to work for 'no folders' view

Hi,
Thanks for the jquery script. Found that it is not working in my case for default view of 'no folders' -- the clickable URL formed seems to ignore folder name. Any tips? Thanks in advance.

Posted 16-Oct-2013 by Bala S Haran
Eleftherios

Web form

Works fine thank you! What if I want to open the form as a web form though?

Posted 22-Oct-2013 by Eleftherios
Graham Lower

Another Direction

Another option to address this is to take a look at JSLINK, where you can override the rendering of given fields.  While I wasn't able to take it all the way, I was able to provide a custom render for DocIcon... but it uses the attachment icon instead.
 

Posted 17-Dec-2013 by Graham Lower
Bala Haran

Thank you!

Thanks for helping us! It works great!

Posted 20-Mar-2014 by Bala Haran
EmilyBen

Error using IE8

Anyway we can get this to work for IE8.  Most of our users in India are still on IE8 and its not working.

Posted 25-Mar-2014 by EmilyBen
EmilyBen

Error using IE8

Anyway we can get this to work for IE8.  Most of our users in India are still on IE8 and its not working.

Posted 25-Mar-2014 by EmilyBen
Kathy

IE8

Any way to get this to work with IE8

Posted 25-Mar-2014 by Kathy

Notify me of comments to this article

E-mail:
   

Add Comment

Title:

 
Comment:
Email:

   


Name:

 
Url: