3

we are implementing a feature in sharepoint where the user can share documents, we are reworking our own UI to make it easier for the end user. We have a modal popup where you can select multiple users, once you click okay, they will receive a email and the permissions to edit the shared document.

In the user selection, we want to use a Modal, i know sharepoint already has a Modal where you can select multiple users, i was wondering if there where any ways we could use that one and change the OnOkButtonClick event to redirect to our custom functions to give the users permissions etc...

Thanks :D

1 Answer 1

8

There is this SP.UI.ModalDialog class (MSDN doku). With dialogOptions you can specify, how will your page behave after the user closes the dialog.

function OpenMasterdataDialog(strPageURL) {
    var dialogOptions = SP.UI.$create_DialogOptions();
    dialogOptions.url = yourPageWithDialogContent;
    dialogOptions.width = 750;
    dialogOptions.height = 950;
    dialogOptions.dialogReturnValueCallback = closedCallback; // Function to capture dialog closed event
    SP.UI.ModalDialog.showModalDialog(dialogOptions);
    return false;
}

function closedCallback(dialogResult) {
   //your method to redirect to new page
}
1
  • This would be a new modal, am looking for ways to use already existing modals with all the controls already set and then just change the Callback on the OK button. An exemple of this would be when you go to site settings > site permissions > grant permission, the modal popup as what i need, cant i just use that one ? Apr 12, 2012 at 15:50

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.