Friend : I have a hyperlink column in a SharePoint list. When i click on it, the link takes me to a new page. I want it to open in a modal dialog. Is it possible?How do you do it?
Me : Oops, I forgot how I implemented it. Let me check and get back to you.
So, I was faced yet again with this requirement and it took me some time to think how I had done it earlier. It was one those moments in a programmer’s life where you know it is possible, you know you have done it but you’ve simply forgotten how you did it.
After finding out how I had done it, I decided that I better write about it.
We have a list with hyperlink column. On clicking the link a page should open in modal dialog.
The Solution & The hurdles
So, what do we do? JSLink to the rescue
Step 1 :
Create the basic hyper link column and insert some values. You should now have a list that looks like the below screen shot
Step 2 :
Step 3 :
I have used the link
as I had saved it at this location. You can use any other location you prefer, just make sure the list view webpart can reach the file.
Save all your changes and test. The link should now open in a modal dialog.