window.Asc.plugin.onMethodReturn

Description

The window.Asc.plugin object method that allows to return the result of the previously executed method. It can be used to return data after the execution of the window.Asc.plugin.executeMethod(...) method.

Usage

This method should be used in the following way:

window.Asc.plugin.onMethodReturn = function(returnValue){...}
Example
window.Asc.plugin.executeMethod("InsertAndReplaceContentControls", [_obj]);
window.Asc.plugin.onMethodReturn = function(returnValue) {
    if (window.Asc.plugin.info.methodName == "InsertAndReplaceContentControls") {
        window.Asc.plugin.executeMethod("GetAllContentControls");
    } else if ("GetAllContentControls") {
        window.Asc.plugin.executeCommand("close", console.log(JSON.stringify(returnValue)));
    } 
};