[]
• new StatusBar(host
, options?
)
Represents status bar.
example
let statusBar = new GC.Spread.Sheets.StatusBar.StatusBar(document.getElementById('statusBar'),
{items: [new GC.Spread.Sheets.StatusBar.StatusItem('labelItem', {menuContent: 'label'})]});
Name | Type | Description |
---|---|---|
host |
HTMLElement |
The DOM Element. |
options? |
IStatusBarOptions |
- |
▸ add(item
, position
): boolean
Add the item instance to the StatusBar.
example
let StatusItem = GC.Spread.Sheets.StatusBar.StatusItem;
let spanItem = new StatusItem('spanItemName', {menuContent: 'span', value: 'spanValue'});
let spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"));
let statusBar = new GC.Spread.Sheets.StatusBar.StatusBar(document.getElementById('statusBar'));
statusBar.bind(spread);
statusBar.add(spanItem);
Name | Type | Description |
---|---|---|
item |
StatusItem |
The instance of the child of StatusItem. The child extends from StatusItem. |
position |
number |
The position is items index in all items array. Start from 0. Items display position is also related to align. If position is invalid or undefine, place it by default. |
boolean
Add item result. Return true if add success, else failed.
▸ all(): StatusItem
[]
Get all item list.
example
let spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"));
let statusBar = new GC.Spread.Sheets.StatusBar.StatusBar(document.getElementById('statusBar'));
statusBar.bind(spread);
let itemList = statusBar.all();
statusBar.remove(itemList[0]);
The item list on statusbar.
▸ bind(context
): void
Bind the context of the StatusBar.
example
let spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"));
let statusBar = new GC.Spread.Sheets.StatusBar.StatusBar(document.getElementById('statusBar'));
statusBar.bind(spread);
Name | Type | Description |
---|---|---|
context |
Workbook |
The context of the StatusBar. The context can trigger the status change of StatusBar. Here the context is the instance of GC.Spread.Sheets.Workbook. |
void
▸ dispose(): void
Dispose the StatusBar and unbind all events.
example
let spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"));
let statusBar = new GC.Spread.Sheets.StatusBar.StatusBar(document.getElementById('statusBar'));
statusBar.bind(spread);
// do something
statusBar.dispose();
void
▸ get(itemName
): StatusItem
Get the item by item name.
example
let StatusItem = GC.Spread.Sheets.StatusBar.StatusItem;
let spanItemName = 'spanItemName';
let spanItem = new StatusItem(spanItemName, {menuContent: 'span', value: 'spanValue'});
let spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"));
let statusBar = new GC.Spread.Sheets.StatusBar.StatusBar(document.getElementById('statusBar'));
statusBar.bind(spread);
statusBar.add(spanItem);
let spanItemInstance = statusBar.get(spanItemName);
Name | Type |
---|---|
itemName |
string |
The StatusItem whose itemName is specified.
▸ remove(itemName
): boolean
Remove the item from the StatusBar.
example
let StatusItem = GC.Spread.Sheets.StatusBar.StatusItem;
let spanItemName = 'spanItemName';
let spanItem = new StatusItem(spanItemName, {menuContent: 'span', value: 'spanValue'});
let spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"));
let statusBar = new GC.Spread.Sheets.StatusBar.StatusBar(document.getElementById('statusBar'));
statusBar.bind(spread);
statusBar.add(spanItem);
// do something
statusBar.remove(spanItemName);
Name | Type | Description |
---|---|---|
itemName |
string |
The name of the StatusItem. |
boolean
If true means remove success, else failed.
▸ unbind(): void
Unbind the context of the StatusBar.
example
let spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"));
let statusBar = new GC.Spread.Sheets.StatusBar.StatusBar(document.getElementById('statusBar'));
statusBar.bind(spread);
// do something
statusBar.unbind();
void
▸ update(): void
Update the StatusBar.
example
let spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"));
let statusBar = new GC.Spread.Sheets.StatusBar.StatusBar(document.getElementById('statusBar'));
statusBar.update();
void