ONLYOFFICE / DocumentServer

ONLYOFFICE Docs is a free collaborative online office suite comprising viewers and editors for texts, spreadsheets and presentations, forms and PDF, fully compatible with Office Open XML formats: .docx, .xlsx, .pptx and enabling collaborative editing in real time.
https://www.onlyoffice.com
GNU Affero General Public License v3.0
4.86k stars 1.09k forks source link

AddContentControlCheckBox Report an error #2562

Open RickerAndersons opened 9 months ago

RickerAndersons commented 9 months ago

This issue is unique.

Operating System of DocumentServer

Linux (RPM package)

Version information

7.5.1

Expected Behavior

Use the Api.PluginMethod_AddContentControlCheckBox to add a check box

Actual Behavior

I use callCommand to call this method

Api.pluginMethod_AddContentControlCheckBox({"Checked": false, "CheckedSymbol": 9756, "UncheckedSymbol": 9744}, {"Id" : 100, "Tag" : "tag", "Lock" : 0});

But the editor report an errot, like this: Uncaught TypeError: this.una is not a function image

Reproduction Steps

No response

Additional information

Api.pluginMethod_AddContentControlList method is right

askonev commented 9 months ago

api plugin and api buidler are different layers isolated from each other. CallCommand executes api buidler methods. The pluginMethod_AddContentControlList method is an api plugin method not available for execution from the api buidler context by design.

The way to use this method is as follows

https://api.onlyoffice.com/plugin/executemethod/text/addcontentcontrolcheckbox

window.Asc.plugin.executeMethod ("AddContentControlCheckBox", [
    {
        "Checked" : false,
        "CheckedSymbol" : 9756,
        "UncheckedSymbol" : 9744
    },
    {
        "Id" : 7,
        "Tag" : "{tag}",
        "Lock" : 0
    }
]);
RickerAndersons commented 9 months ago

Thanks for answering