Tuesday 11 March 2014

SharePoint SP.UI.ModalDialog

SharePoint SP.UI.ModalDialog
function openModalD() {
var options = {
url: "http://bing.com",
title: '',
width: 660,
height: 310,
allowMaximize: true,
dialogReturnValueCallback: PageReLoad
//dialogReturnValueCallback: RefreshOnDialogClose
}
SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);
}
function PageReLoad() {
location.reload(true);
document.referrer;
}
In the above code, we can pass Call Back method after closing the modal window.
dialogReturnValueCallback: PageReLoad
//dialogReturnValueCallback: RefreshOnDialogClose
If i use:
dialogReturnValueCallback: PageReLoad
I have to write my own PageReLoad method then i have to write code.
If i use: dialogReturnValueCallback: RefreshOnDialogClose
SharePoint will take care to refresh the page.