Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

I created a Html page for my SharePoint site that I open it in Modal dialog, but I cannot close it.

$
0
0

Below is the code for open my page that processes some data on my SharePoint list item.

             

function displayApprovalModaldig(responseID)
{
   // alert('display Approval is called.');
   // alert(responseID);
   listitemUrl = _spPageContextInfo.webAbsoluteUrl + "/SitePages/Approval.aspx?audit=" + Audit + "&response=" + responseID; 

  // alert(Audit);
  // alert(listitemUrl);
   var options = {
        url: listitemUrl,
        title:  "Approval Process",
        allowMaximize: true,        
        showClose: true,
         height: 1500,

        dialogReturnValueCallback: Function.createDelegate(null, popupAuditClose)
    };
        SP.UI.ModalDialog.showModalDialog(options);

}

I have a button on my page like below:

<button id="btnClose" onClick="MyWindowClose()"  type="button">Close</button> 

  

function MyWindowClose()
  {
    alert('Close is clicked.');

    window.close();
  }

I have tried different methods to close the Modal dialog by clicking the button but nothing seems to work.How can I trigger the click of the X on the top right hand side of my page?


faye fouladi


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>