Saturday, 17 December 2016

How to refresh the page after closing dialog in SharePoint?

Below code help is to refresh the page after closing the dialog in SharePoint:

 var options = {
    url: 'https://sp2013dev/sites/dev/Shared%20Documents/Forms/EditForm.aspx?ID=9',
    title: 'My Title',
    allowMaximize: false,
    showClose: true,
    width: 400,
    height: 350,
    dialogReturnValueCallback: function(result){
        if (result == SP.UI.DialogResult.OK) {
        if (result == SP.UI.DialogResult.cancel) {
            //do nothing, modal was closed

   SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options); 

When you click Save button in model dialog above code refresh the page. And if you click close/cancel it will do nothing and will return to parent page.

Hope this helps....


No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...