When you use lookup to the list automatically SharePoint give link to the lookup item on list view.
Check it out….
Lookup column with Hyperlinks |
But many times, we don’t want those Hyperlinks on the list view, as we can remove it from SharePoint Designer but it’s a hectic task.
Simply add JQuery to remove those Hyperlinks.
First, get the URL of the link using Developer tool of IE or Firebug of Firefox browser. we are going to some part of URL in the below code.
Get URL using Developer tool of IE |
Then copy following JQuery code to the HTML form WebPart on list view.
Jquery For MOSS 2007/WSS 3.0:
Jquery For MOSS 2007/WSS 3.0:
Note: Change highlighted text as per your context.
Jquery For SharePoint 2010/SharePoint Foundation 2010:
Note: Change highlighted text as per your context.
If View is Grouped, set list view setting "By default, show groupings:" to Expanded
List view with removed hyperlinks to Lookup columns:
Note: Change highlighted text as per your context.
If View is Grouped, set list view setting "By default, show groupings:" to Expanded
List View setting: Make sure that By default, show groupings: Expanded |
List view with removed hyperlinks to Lookup columns:
Live simple!
Hello, Amit!
ReplyDeleteThank you SO Much for the post on removing URLs in lookup fields. This option allows users more flexibility than other codes I’ve seen!
I have a quick question… Is it possible to get this code to work on webparts that have groupings? It seems to be workign fine in a standard list, but once groupings are added the links appear. Do you have any suggestions?
Thanks!!!
Hi Rudy,
ReplyDeleteYou can use following function for Grouped View.
function ExpGroupRenderData(htmlToRender, groupName, isLoaded) {
}
As ExpGroupRenderData overwrites the default SharePoint function. This function is needed for collapsed groupings.
I have also updated the post.
Thanks, Amit. This added script seems to remove all documents or items in the grouped list. I know they are there because the count is working, but the rows with the docs and items are gone.
ReplyDeleteAny ideas?
Rudy
Hi Rudy,
ReplyDeleteI have updated the post for SharePoint 2010 Group View.
Please check and let me the results.
the last item Hyperlink is not removed .My view is grouped so I used
ReplyDeletefunction ExpGroupRenderData(htmlToRender, groupName, isLoaded) {
Removelink(); // Call to Removelink function on Page Load
}
Any Idea
Hi Anshul,
ReplyDeleteI have updated the post for the same.
hi amit,
ReplyDeleteu posted good one
but coming to my self i want to hide the hyper links in list view / display form.
i am using your code it working fine for a field containing single value with hyper ink.
but for multiple values it not working.
Really a good one but not working when we move on Paging from one page to another
ReplyDeletegans