SPDisplayRelatedInfo Name column for a document library

Jul 4, 2011 at 4:36 PM

Hi,

Thanks for these jQuery tools.  Really useful!

I am able to use SPDisplayRelatedInfo to bring up a table which shows various columns in a document library. 

However the column I would like to bring up is the Name column, just as it appears on a document library as a hyperlink to open th document.

Is it possible?

Thanks in advance,

Mark

Coordinator
Jul 5, 2011 at 4:35 PM

When you try this, what results do you get? You should probably be using the column FileLeafRef.

M.

Jul 5, 2011 at 4:54 PM

Thanks for your reply.

I have tried FileLeafRef however the result is not a hyperlink and for a document called Tester.docx this appears:

1;#Tester CRM.docx

I have a knowledge base which is a document library which has the metadata Sub-Category.

When a user chooses Sub-Category when adding a new support ticket I would like a hyperlink to open the documents with that sub category to appear.

I can get the correct documents to show - I can tell as I can bring up ID, etc,  What I can't do is bring up  the Name column, just as it appears on a document library as a hyperlink to open the document.

My code:

$().SPServices.SPDisplayRelatedInfo({
columnName: "SubCategory",
relatedList: "Knowledge",
relatedListColumn: "SubCategory",
relatedColumns: ["SubCategory", "FileLeafRef"] ,
displayFormat: "table"

 

Many thanks,

Mark

Coordinator
Jul 5, 2011 at 5:01 PM

It looks like I'm not handling the FileLeafRef column properly, and I'll need to fix that.

That said, what do you want the behavior to be on your page? Do you simply want to show the document name as a link which will launch the corresponding document? (It will launch either in the client app or in the browser based on the settings.) Alternatively, the link could take you to the properties for the document (i.e., the DispForm.aspx page).

M.

Jul 5, 2011 at 5:06 PM

Hi,

In this case I would like to show the document name as a link (ideally without the extention e.g. docx - as per the document library view) which will launch the corresponding document in the client app.

Thanks for your help.  It is greatly appreciated!

Mark

Coordinator
Jul 5, 2011 at 6:36 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.