Open SharePoint popup/dialog using java script:

//Place below code in Content Editor Web part
//Pass list item id to the function
<a href='#' onclick='openpopupdialog(" + id + ")'>See full item>></a>

function openpopupdialog(id) {
        options = SP.UI.$create_DialogOptions();
         options.url = 'http://sp2010.com/sites/subsite/Lists/fame/DispForm.aspx?isDlg=1&ID=' + id;
         options.height = 650;
         options.dialogReturnValueCallback = Function.createDelegate(null, CloseCallback);
         void (SP.UI.ModalDialog.showModalDialog(options))
     }
     function CloseCallback(result, target) {

         location.href = window.location.href;
     }

Comments

Popular posts from this blog

Copilot Studio Azure OpenAI with SharePoint Data Source

Create and Deploy custom copilot to SharePoint Site (Part 2)

Copilot Announcements from Microsoft Build 2024