[]
• new NameBox(host
, workbook
, options?
)
Represents name box.
Name | Type | Description |
---|---|---|
host |
string | HTMLElement |
The DOM Element. |
workbook |
Workbook |
- |
options? |
INameBoxOptions |
- |
• options: INameBoxOptions
Indicates the options of the name box.
property
[enableAddCustomName] Indicates whether enable add custom name when input a name which is not existed to the selector.
property
[enableNavigateToRange] Indicates whether enable navigate to the named range or drawing item when input its name or click on custom list item.
property
[showCustomNameList] Indicates whether show the custom name list dropdown indicator.
property
[dropDownMaxHeight] Indicates the drop down list element max height.
▸ dispose(): void
Dispose the NameBox and unbind all events.
example
var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"));
var nameBox = new GC.Spread.Sheets.NameBox.NameBox(document.getElementById('nameBox'), spread);
// do something
nameBox.dispose();
void
▸ getHost(): HTMLElement
get the NameBox host element.
example
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
refresh the NameBox and sync the name box value to the work sheet selection.
example
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