Wednesday, May 30, 2012

Open new modal popup while closising the parent modal popup.

Parent page code :

var siteUrl = http://siteurl/;

var modalpage = { url: siteUrl + "/_layouts/MyModal/Pages/NewModalForms.aspx", title: "New  Input Form", allowMaximize: false, width: 700, height: 300, showClose: true, dialogReturnValueCallback: silentCallback };

function openModalForm() {
SP.UI.ModalDialog.showModalDialog(modalpage);
}

function silentCallback(dialogResult, returnValue)
{

if (returnValue != null && returnValue != "")
{
OpenPopUpPageWithTitle(siteUrl + '/Lists/lst/NewForm.aspx?' + returnValue, RefreshOnDialogClose, null, null, 'New Modal Form');
}

}
 
Modalpopup page code
 
SP.UI.ModalDialog.commonModalDialogClose(SP.UI.DialogResult.cancel, queryString);
 

No comments: