SPDisplayRelatedInfo - Link to Item

Sep 17, 2014 at 11:19 PM
Hello,

I'm using SPDisplayRelatedInfo successfully, but I'd like to include the "Title" column as a hyperlink, the way it appears in list views. I imagine that when a user clicks the title link it would open the display form for the item. I'm on SP2013, so it would be even better if it opened as a pop-up.

For "relatedcolumns" I've tried the static names of "Title" and "LinkTitleNoMenu" which only displays text and no hyperlink. Is there a way to do this?

Thanks for any help. I'm really enjoying SPServices.
Sep 18, 2014 at 8:47 PM
I don't think you're going to find a complete solution in the SPDisplayRelatedInfo function alone. It's returning the data you requested just as it's stored but the data returned isn't inherently in a hyperlink format. You will have to run an operation in the completefunc option to to some post processing of the result. If you look at the sourcecode of SPDisplayRelatedInfo, you'll see that it identifies the container div it creates with a distinct label. You will have to do something in there based on the value of the selected dropdown to replace the text of the target cell with a hyperlink.

As far as creating a pop-up in SP2013, I haven't tried it yet but I've done it in SP2010. I don't know if the mechanics have changed or not but here's a couple examples:

Try the method...
OpenPopUpPageWithTitle(strURL)   (_where "strURL" is the complete path to the page_)
I use that method for custom pages I've created
or....
Add the querystring argument "IsDlg=1" to the URL you are going for such as....
https://domain/sites/name/Lists/SomeListName/EditForm.aspx?ID=12&IsDlg=1
I use that method for out of the box forms

Geoff