FormulaEditor.addOperator

Syntax

addOperator(settings: Object);

Parameters

settings.  JSON object that contains parameters of added operator. An object must contain the following fields: Text - text value of operator; Desc - operator description.

Description

The addOperator method adds an operator to the list of operators.

Example

To execute the example, the page must contain the FormulaEditor component named formulaEditor (see Example of Creating the FormulaEditor Component). The example must be placed in the <script> tag. Get a list of initial operators:

// Get initial operators
console.log("Initial operators:");
for (var i in formulaEditor.getInitialOperators()) {
    console.log(formulaEditor.getInitialOperators()[i].Content);
}

As a result the console displays the list of initial operators:

Initial operators:

=

<>

<

>

<=

>=

()

+

-

*

/

DIV

MOD

NOT

IN

AND

OR

 

Add an operator to the list of formula editor operators:

// Add an operator
formulaEditor.addOperator({
    Text: "!",
    Desc: {
        Entity: "!",
        Descr: "Factorial operator",
        LinkToFullDescr: "#"
    },
});

As a result a new operator is added to the list of operators. On selecting an operator, its information is displayed:

See also:

FormulaEditor