SpreadJS Documentation
FormulaTextBox Constructor
GC.Spread.Sheets.FormulaTextBox Namespace > FormulaTextBox class : FormulaTextBox Constructor
The DOM element. It can be INPUT, TEXTAREA, or editable DIV.
The options. Default is {rangeSelectMode: false, absoluteReference: false}
Represents a formula text box.
Syntax
var instance = new GC.Spread.Sheets.FormulaTextBox.FormulaTextBox(host, options);
function FormulaTextBox( 
   host : Object,
   options : Object
) : FormulaTextBox;

Parameters

host
The DOM element. It can be INPUT, TEXTAREA, or editable DIV.
options
The options. Default is {rangeSelectMode: false, absoluteReference: false}
Example
This example adds a formula text box control to the page.
<!DOCTYPE html>
<html>
<head>
    <title>SpreadSheets</title>
<link href="./css/gc.spread.sheets.12.0.0.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="./scripts/gc.spread.sheets.all.12.0.0.min.js"></script>

<script type="text/javascript">
window.onload = function(){
                var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"),{sheetCount:3});
                var activeSheet = spread.getActiveSheet(); 
activeSheet.setArray(0, 0, [1, 2, 3, 4, 5]);
var fbx = new GC.Spread.Sheets.FormulaTextBox.FormulaTextBox(document.getElementById("formulaTextBox"));
fbx.workbook(spread);
                      }
    </script>
</head>
<body>
<div id="ss" style="height: 500px; width: 600px"></div>
 <input type="text" id="formulaTextBox" />
</body>
</html>
This example allows you to select a range.
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Spread.Sheets Sample</title>
    <link href="./css/gc.spread.sheets.excel2013white.12.0.0.css" rel="stylesheet"/>
    <script src="./scripts/gc.spread.sheets.all.12.0.0.js" type="application/javascript"></script>
    <script type="text/javascript">
        window.onload = function(){
            var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 1 });
            rangeSelector = new GC.Spread.Sheets.FormulaTextBox.FormulaTextBox(document.getElementById("ftb"), {rangeSelectMode: true});
            rangeSelector.workbook(spread);
        }
        function buttonClick(){
            alert(rangeSelector.text());
        }
    </script>
</head>
<body>
<div id="ss" style="width:50%; height:400px; border:1px solid gray;"></div>
<br/>
<div id="ftb" style="width:50%;height:20px;border:1px solid gray"></div>
<br/>
<button onclick="buttonClick()">Get Range Text</button>
</body>
</html>
See Also

Reference

FormulaTextBox class