3

I have SharePoint All Items Custom List View which I would like to customize using JS Link feature.

Currently whenever user clicks on "Title" link on any item it opens Listform.aspx with detail information about that List Item. Instead of opening Listform.aspx in a similar window, I would like to open it in a Modal Dialog box where user can see all the details and if required make changes or close the Dialog and return to List View. is it possible do this with JS Link?

1
  • 1
    This is easy without doing any jslink way. Needed to navigate to advanced settings of list and change option open forms in dialog to yes. Couldn't figure. Out ealier.
    – user12345
    Apr 8, 2014 at 15:56

2 Answers 2

7

You need to open the DispForm.aspx page for the List Item in a Modal Dialog..

The URL for the List Item will be: http://sharepoint/Lists/ListName/DispForm.aspx?ID=1 where ID is the List Item Id..

Now opening it in a modal dialog, write a function in JavaScript like:

function openDialog( pageUrl ) {  
   SP.UI.ModalDialog.showModalDialog(   
     {  
       url: pageUrl,
       width: 500,  
       height: 500,  
       title: "Title of the Dialog"  
     }  
   );  
 }  

Call this from the anchor / title of the list item..

1
  • Nice one, worked perfect.
    – Asad Refai
    Jun 7, 2016 at 13:28
0

I had a similar requirement .Please check the link ,hope this helps.

Refer: Newform.aspx in a dialog box

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.