We can pass the value from SharePoint Modal dialog to its parent window.
After a long search i found the below solution:
Parent Window:
function OpenPopUp() {
var siteCollectionURL = _spPageContextInfo.siteAbsoluteUrl;
var options = {
url: siteCollectionURL + "/Sitepages/PopUpView.aspx",
dialogReturnValueCallback: CloseCallback,
height: 900,
width: 800
};
SP.UI.ModalDialog.showModalDialog(options);
return false;
}
function CloseCallback(result, target) {
///Value given at Popup window will come as target value
alert(target);
}
PopUp window:
function Successclosepopup() {
var returnValue = "PopUp Successfully Closed";
SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult.OK, returnValue);
}
Hope this may help you.
Thanks.,
After a long search i found the below solution:
Parent Window:
function OpenPopUp() {
var siteCollectionURL = _spPageContextInfo.siteAbsoluteUrl;
var options = {
url: siteCollectionURL + "/Sitepages/PopUpView.aspx",
dialogReturnValueCallback: CloseCallback,
height: 900,
width: 800
};
SP.UI.ModalDialog.showModalDialog(options);
return false;
}
function CloseCallback(result, target) {
///Value given at Popup window will come as target value
alert(target);
}
PopUp window:
function Successclosepopup() {
var returnValue = "PopUp Successfully Closed";
SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult.OK, returnValue);
}
Hope this may help you.
Thanks.,
No comments:
Post a Comment