Pergunta

I have a list called "XYZ" that stores users in it. I have a page with summary links web part that also has a link which would open a modal popup.

This popup should show all the list items of "XYS" list.

I am using the client object model with javascript for the implementation in SharePoint 2010.

Foi útil?

Solução

 SP.UI.ModalDialog.showModalDialog({ 
            url: "URL of List", 
            title: "Title of page", 
            allowMaximize: true, 
            showClose: true, 
            width: 850, 
            height: 600, 
            dialogReturnValueCallback: newCallback 
        });
function newCallback(dialogResult, returnValue) { 
   SP.UI.ModalDialog.RefreshPage(SP.UI.DialogResult.OK); 
}

Outras dicas

To open a popup in Sharepoint, you can use the function named OpenPopUpPageWithTitle. The syntax looks like this

OpenPopUpPageWithTitle('URL of your list', callback, width, height, 'Custom title');

if your link have an id of 'ABC', you can add a click event to this link using JQuery like this :

$(document).ready(function() {
  $('#ABC').on('click',function() {
    OpenPopUpPageWithTitle('URL of your page', callback, width, height, 'Custom title');
  });
});

If you don't need a callback function leave this parameter to null.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a sharepoint.stackexchange
scroll top