none
Displaying ListView WebPart item in a modal dialog box in SharePoint 2013 RRS feed

  • Question

  • Hi,

    I am trying to display the SharePoint 2013 list items in a modal dialog box. In list it is working fine but when display the list in a webpart with search box, it doesn't work.

    Thanks in advance for any suggestion.


    • Edited by pointtoshare Wednesday, January 18, 2017 10:16 AM
    Wednesday, January 18, 2017 10:15 AM

Answers

All replies

  • Hi pointtoshare,

    We can use JavaScript below to display list view items in a model dialog:

    <input type="button" onclick="openDialog('http://sp/sites/teams/Lists/List8/AllItems.aspx')" value="test">
    <script type="text/javascript">
    function openDialog(pageUrl) {  
       SP.UI.ModalDialog.showModalDialog(   
         {  
           url: pageUrl,
           width: 500,  
           height: 500,  
           title: "Title of the Dialog"  
         }  
      );  
    }
    
    </script>
    

    You can add the script above into a content editor web part and when clicking the button, it will display a model dialogue with list items and search box like below:


    Thanks

    Best Regards


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Thursday, January 19, 2017 6:03 AM
  • Hi Jerry,

    Thanks very much for your reply.

    This solution is very much closer to my problem. Basically, I already have a webpage and a ListViewWebPart embedded in it. I want an individual item to be opened in a modal dialog once I click on any item link. Hope you can help me out of this.

    Thanks again.

    Thursday, January 19, 2017 6:20 AM
  • Hi pointtoshare,

    If you want a specific item opened in a model dialogue, then we can simply set list settings like below:

    List Settings -> Advance Settings:

    Thanks

    Best Regards


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Thursday, January 19, 2017 6:49 AM
  • Hi Jerry,

    I need to inform you another thing, I have a custom list view which contains only one rich text field. I am generating a HTML user profile with with the title filed, image and some brief text through Nintex and setting it up on that rich text field. I am displaying that special view on another webpage through ListViewWebpart. The modal dialog is not working for the items on that view.

    Please let me know if you need any further information.

    Thursday, January 19, 2017 7:08 AM
  • Hi pointtoshare,

    Then we can bind Jquery Dialogue plugin with list td to show the user profile information into a model dialogue:

    Jquery Dialog

    How to open a jquery ui dialogue on clicking of HTML table cell

    Thanks

    Best Regards


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Friday, January 20, 2017 5:37 AM