[]
• new NameBox(host
, workbook
, options?
)
名前ボックスを表します。
名前 | 型 | 説明 |
---|---|---|
host |
string | HTMLElement |
DOM要素。 |
workbook |
Workbook |
- |
options? |
INameBoxOptions |
- |
• options: INameBoxOptions
名前ボックスのオプションを示します。
プロパティ
[enableAddCustomName] セレクターに存在しない名前を入力したときにカスタム名を追加できるようにするかどうかを示します。
プロパティ
[enableNavigateToRange] 名前を入力するか、カスタムリストのアイテムをクリックしたときに名前付き範囲または描画アイテムへの移動を有効にするかどうかを示します。
プロパティ
[showCustomNameList] カスタム名リストのドロップダウンインジケーターを表示するかどうかを示します。
プロパティ
[dropDownMaxHeight] ドロップダウンリスト要素の最大高さを示します。
実例
var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"));
var div = document.createElement('div');
div.id = 'nameBox';
div.style.width = '300px';
div.style.height = '50px';
document.getElementById('panel').appendChild(div);
var nameBox = new GC.Spread.Sheets.NameBox.NameBox(document.getElementById('nameBox'), spread);
Namebox.options.enableAddCustomName = false;//名前ボックスの入力ボックスにカスタム名を追加できません。
Namebox.options.enableNavigateToRange = false;//選択した範囲を名前ボックスの入力ボックスの値に入れ替えることはできません。
Namebox.options.showCustomNameList=false;//右側の下向き矢印ボタンでカスタム名リストを開くことができず、ボタンが非表示になります。
Namebox.options.dropDownMaxHeight=100;//カスタム名リストのホストDOM要素の高さが100pxを超えないようにします。
▸ dispose(): void
NameBoxを破棄し、すべてのイベントを非連結します。
実例
var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"));
var nameBox = new GC.Spread.Sheets.NameBox.NameBox(document.getElementById('nameBox'), spread);
//ここに実装します。
nameBox.dispose();
void
▸ getHost(): HTMLElement
NameBoxのホスト要素を取得します。
実例
var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"));
var nameBox = new GC.Spread.Sheets.NameBox.NameBox(document.getElementById('nameBox'), spread);
var host = nameBox.getHost();
HTMLElement
▸ refresh(): void
NameBoxを更新し、名前ボックスの値をワークシートの選択に同期します。
実例
var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"));
var nameBox = new GC.Spread.Sheets.NameBox.NameBox(document.getElementById('nameBox'), spread);
var sheet = spread.getActiveSheet();
sheet.setSelection(0, 0, 3, 3);
nameBox.refresh();
void