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

Feature Request: Custom JS Code Execution in Table Editor #2754

Open eSkry opened 5 months ago

eSkry commented 5 months ago

This issue is unique.

Your idea.

Description: Add a feature for the table editor that executes JS code.

Idea: Implement the ability to easily create custom complex calculations by writing JS code. The function should accept a variable number of arguments, which will be used in the JS code. The last argument should be the JavaScript code as a string.

Example Formula: =JSEXEC(arg1, arg2, arg3, "function myFunc(n, r, u) { for (var c = 0, f = 0; f < u; f++) c += n / f; return c; } myFunc(arg1, arg2, arg3);"). The code will likely need to be minified for string representation.

Source Code:

function(price, period, count) {
    /* calculate */
    var res = 0;
    for (var i = 0; i < count; i++) {
        res += price / i;
    }
    return res;
}

This sentence is a simplified format of my previous sentence.

askonev commented 5 months ago

@eSkry Thanks for your issue. I have issued an enhancement #68410 on our private bug tracker

Rita-Bubnova commented 5 months ago

The issue is actual in DocumentServer. Moving this issue to DocumentServer, because it is our main repository.