SpreadJS製品ヘルプ
FormulaTextBox コンストラクタ
GC.Spread.Sheets.FormulaTextBox 名前空間 > FormulaTextBox クラス : FormulaTextBox コンストラクタ
DOM要素。INPUT、TEXTAREA、または編集可能なDIVを使用できます。
オプション。デフォルトは{rangeSelectMode: false, absoluteReference: false}です。
数式テキストボックスを表します。
シンタックス
var instance = new GC.Spread.Sheets.FormulaTextBox.FormulaTextBox(host, options);
function FormulaTextBox( 
   host : HTMLElement,
   options : Object
) : FormulaTextBox;

パラメータ

host
DOM要素。INPUT、TEXTAREA、または編集可能なDIVを使用できます。
options
オプション。デフォルトは{rangeSelectMode: false, absoluteReference: false}です。
使用例
次のサンプルコードは、数式テキストボックスコントロールをページに追加します。
<!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>
<!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>
関連トピック

参照

FormulaTextBox クラス