[]
        
(Showing Draft Content)

GC.Spread.Sheets.FormulaPanel.FormulaEditor

Class: FormulaEditor

Sheets.FormulaPanel.FormulaEditor

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new FormulaEditor(host, options?)

Represents a formula editor.

example

window.onload = function(){
     var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"));
     formulaEditor = new GC.Spread.Sheets.FormulaPanel.FormulaEditor(document.getElementById("fe"));
     formulaEditor.attach(spread);
}

Parameters

Name Type Description
host HTMLElement The DOM element.
options? IFormulaEditorOptions -

Properties

options

options: IFormulaEditorOptions

Indicates the options of the formula editor.

property tabSize - Indicate the number of spaces inserted when the "Tab" key is pressed. Default is 4.

property formatWidthLimit - Indicates the width limit when formatting, Default is 'auto'. 'auto' means that this follows the width of the dom and will try to avoid the width of a line exceeding the width of the dom.

example

formulaEditor.options.tabSize = 2;
formulaEditor.options.formatWidthLimit = -1;

Methods

attach

attach(workbook): any

description attach to a workbook for formula editor.

Parameters

Name Type Description
workbook Workbook Indicates the workbook which is attached.

Returns

any

void


commandManager

commandManager(): CommandManager

Gets the command manager.

example

//This example executes a command that performs a specified action.
formulaEditor.commandManager().execute({ cmd: "formatDocument" });

Returns

CommandManager

The command manager.


destroy

destroy(): void

Destroys current formula editor.

Returns

void


detach

detach(): void

description detach the workbook for formula editor.

Returns

void

void


format

format(): void

format the document(formula string).

Returns

void


refresh

refresh(): void

refresh the formula editor.

Returns

void


text

text(value?): string

Gets or sets the text.

Parameters

Name Type Description
value? string The text.

Returns

string

If no value is set, returns the text; otherwise, there is no return value.