Scenario:
I planned to use SharePoint popup in client project.
Solution:
I did a quick POC and here's what you need to do to make it work.
What goes in Parent Window Header ?
Add following JavaScript in the header section :
function OpenMyWebPage(popupTitle, popupUrl) { var options = { url: popupUrl, autoSize: true, showClose: true, title: popupTitle, dialogReturnValueCallback: function (dialogResult) { if (dialogResult == SP.UI.DialogResult.OK) { window.document.location.reload(true); } } }; SP.UI.ModalDialog.showModalDialog(options); }How to launch the Popup
EditWhat goes in Popup Window - Save button at the end ( to refresh the parent window )
Context.Response.Write("<script type='text/javascript'>window.frameElement.commitPopup();</script>"); Context.Response.Flush(); Context.Response.End();What goes in Popup Window - Cancel button
Nothing is needed hereHidding Ribbon - Add at the end , in case you dont want to display ribbon
0 comments:
Post a Comment