Skip to main content
replaced http://sharepoint.stackexchange.com/ with https://sharepoint.stackexchange.com/
Source Link

I figured it out! You need to use dialogReturnValueCallback which executes a function after the EditForm window closes.

Go here for details on answer: SharePoint Modal Help - pass value back to parent when closingSharePoint Modal Help - pass value back to parent when closing

Here is the appropriate code from that link:

//you create the Modal dialog like so...

//Dialog Opening
function OpenDialog() {
    var options = SP.UI.$create_DialogOptions();
    options.url = '/_layouts/mySolution/myPage.aspx';
    options.width = 500;
    options.height = 400;
    options.dialogReturnValueCallback = Function.createDelegate(null, CloseCallback);
    SP.UI.ModalDialog.showModalDialog(options);
}

//and then make the return function like this...

// Dialog callback
function CloseCallback(result, target) {
    if (result == SP.UI.DialogResult.OK) {
        // Run OK Code
        // To be consistent with the below... 
        this.dataArray = target.split("^");
        var startDate = new Date(this.dataArray[1]);
        // Note that I use this.dataArray to allow the object to be accessed throughout the code
    }
    if (result == SP.UI.DialogResult.cancel) {
        // Run Cancel Code
    }
}

I figured it out! You need to use dialogReturnValueCallback which executes a function after the EditForm window closes.

Go here for details on answer: SharePoint Modal Help - pass value back to parent when closing

Here is the appropriate code from that link:

//you create the Modal dialog like so...

//Dialog Opening
function OpenDialog() {
    var options = SP.UI.$create_DialogOptions();
    options.url = '/_layouts/mySolution/myPage.aspx';
    options.width = 500;
    options.height = 400;
    options.dialogReturnValueCallback = Function.createDelegate(null, CloseCallback);
    SP.UI.ModalDialog.showModalDialog(options);
}

//and then make the return function like this...

// Dialog callback
function CloseCallback(result, target) {
    if (result == SP.UI.DialogResult.OK) {
        // Run OK Code
        // To be consistent with the below... 
        this.dataArray = target.split("^");
        var startDate = new Date(this.dataArray[1]);
        // Note that I use this.dataArray to allow the object to be accessed throughout the code
    }
    if (result == SP.UI.DialogResult.cancel) {
        // Run Cancel Code
    }
}

I figured it out! You need to use dialogReturnValueCallback which executes a function after the EditForm window closes.

Go here for details on answer: SharePoint Modal Help - pass value back to parent when closing

Here is the appropriate code from that link:

//you create the Modal dialog like so...

//Dialog Opening
function OpenDialog() {
    var options = SP.UI.$create_DialogOptions();
    options.url = '/_layouts/mySolution/myPage.aspx';
    options.width = 500;
    options.height = 400;
    options.dialogReturnValueCallback = Function.createDelegate(null, CloseCallback);
    SP.UI.ModalDialog.showModalDialog(options);
}

//and then make the return function like this...

// Dialog callback
function CloseCallback(result, target) {
    if (result == SP.UI.DialogResult.OK) {
        // Run OK Code
        // To be consistent with the below... 
        this.dataArray = target.split("^");
        var startDate = new Date(this.dataArray[1]);
        // Note that I use this.dataArray to allow the object to be accessed throughout the code
    }
    if (result == SP.UI.DialogResult.cancel) {
        // Run Cancel Code
    }
}

I figured it out! You need to use dialogReturnValueCallback which executes a function after the EditForm window closes.

Go here for details on answer: SharePoint Modal Help - pass value back to parent when closing

Here is the appropriate code from that link:

//you create the Modal dialog like so...

//Dialog Opening function OpenDialog() { var options = SP.UI.$create_DialogOptions(); options.url = '/_layouts/mySolution/myPage.aspx'; options.width = 500; options.height = 400; options.dialogReturnValueCallback = Function.createDelegate(null, CloseCallback); SP.UI.ModalDialog.showModalDialog(options); }

//and then make the return function like this...

// Dialog callback function CloseCallback(result, target) { if (result == SP.UI.DialogResult.OK) { // Run OK Code // To be consistent with the below... this.dataArray = target.split("^"); var startDate = new Date(this.dataArray[1]); // Note that I use this.dataArray to allow the object to be accessed throughout the code } if (result == SP.UI.DialogResult.cancel) { // Run Cancel Code } }

//you create the Modal dialog like so...

//Dialog Opening
function OpenDialog() {
    var options = SP.UI.$create_DialogOptions();
    options.url = '/_layouts/mySolution/myPage.aspx';
    options.width = 500;
    options.height = 400;
    options.dialogReturnValueCallback = Function.createDelegate(null, CloseCallback);
    SP.UI.ModalDialog.showModalDialog(options);
}

//and then make the return function like this...

// Dialog callback
function CloseCallback(result, target) {
    if (result == SP.UI.DialogResult.OK) {
        // Run OK Code
        // To be consistent with the below... 
        this.dataArray = target.split("^");
        var startDate = new Date(this.dataArray[1]);
        // Note that I use this.dataArray to allow the object to be accessed throughout the code
    }
    if (result == SP.UI.DialogResult.cancel) {
        // Run Cancel Code
    }
}

I figured it out! You need to use dialogReturnValueCallback which executes a function after the EditForm window closes.

Go here for details on answer: SharePoint Modal Help - pass value back to parent when closing

Here is the appropriate code from that link:

//you create the Modal dialog like so...

//Dialog Opening function OpenDialog() { var options = SP.UI.$create_DialogOptions(); options.url = '/_layouts/mySolution/myPage.aspx'; options.width = 500; options.height = 400; options.dialogReturnValueCallback = Function.createDelegate(null, CloseCallback); SP.UI.ModalDialog.showModalDialog(options); }

//and then make the return function like this...

// Dialog callback function CloseCallback(result, target) { if (result == SP.UI.DialogResult.OK) { // Run OK Code // To be consistent with the below... this.dataArray = target.split("^"); var startDate = new Date(this.dataArray[1]); // Note that I use this.dataArray to allow the object to be accessed throughout the code } if (result == SP.UI.DialogResult.cancel) { // Run Cancel Code } }

I figured it out! You need to use dialogReturnValueCallback which executes a function after the EditForm window closes.

Go here for details on answer: SharePoint Modal Help - pass value back to parent when closing

Here is the appropriate code from that link:

//you create the Modal dialog like so...

//Dialog Opening
function OpenDialog() {
    var options = SP.UI.$create_DialogOptions();
    options.url = '/_layouts/mySolution/myPage.aspx';
    options.width = 500;
    options.height = 400;
    options.dialogReturnValueCallback = Function.createDelegate(null, CloseCallback);
    SP.UI.ModalDialog.showModalDialog(options);
}

//and then make the return function like this...

// Dialog callback
function CloseCallback(result, target) {
    if (result == SP.UI.DialogResult.OK) {
        // Run OK Code
        // To be consistent with the below... 
        this.dataArray = target.split("^");
        var startDate = new Date(this.dataArray[1]);
        // Note that I use this.dataArray to allow the object to be accessed throughout the code
    }
    if (result == SP.UI.DialogResult.cancel) {
        // Run Cancel Code
    }
}
Source Link
Murf
  • 171
  • 4

I figured it out! You need to use dialogReturnValueCallback which executes a function after the EditForm window closes.

Go here for details on answer: SharePoint Modal Help - pass value back to parent when closing

Here is the appropriate code from that link:

//you create the Modal dialog like so...

//Dialog Opening function OpenDialog() { var options = SP.UI.$create_DialogOptions(); options.url = '/_layouts/mySolution/myPage.aspx'; options.width = 500; options.height = 400; options.dialogReturnValueCallback = Function.createDelegate(null, CloseCallback); SP.UI.ModalDialog.showModalDialog(options); }

//and then make the return function like this...

// Dialog callback function CloseCallback(result, target) { if (result == SP.UI.DialogResult.OK) { // Run OK Code // To be consistent with the below... this.dataArray = target.split("^"); var startDate = new Date(this.dataArray[1]); // Note that I use this.dataArray to allow the object to be accessed throughout the code } if (result == SP.UI.DialogResult.cancel) { // Run Cancel Code } }