[]
• new StatusBar(host
, options?
)
状态栏
代码示例
let statusBar = new GC.Spread.Sheets.StatusBar.StatusBar(document.getElementById('statusBar'),
{items: [new GC.Spread.Sheets.StatusBar.StatusItem('labelItem', {menuContent: 'label'})]});
属性名 | 类型 | 说明 |
---|---|---|
host |
HTMLElement |
DOM元素 |
options? |
IStatusBarOptions |
- |
▸ add(item
, position
): boolean
将项实例添加到StatusBar
代码示例
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);
属性名 | 类型 | 说明 |
---|---|---|
item |
StatusItem |
StatusItem子级的实例 子级从StatusItem扩展 |
position |
number |
位置是所有项数组中的项索引 从0开始项显示位置也与对齐相关 如果位置无效或不确定,则默认放置它 |
boolean
添加项结果 如果添加成功,则返回true,否则失败
▸ all(): StatusItem
[]
获取所有项列表
代码示例
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]);
状态栏上的项列表
▸ bind(context
): void
绑定StatusBar的上下文
代码示例
let spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"));
let statusBar = new GC.Spread.Sheets.StatusBar.StatusBar(document.getElementById('statusBar'));
statusBar.bind(spread);
属性名 | 类型 | 说明 |
---|---|---|
context |
Workbook |
StatusBar的上下文 上下文可以触发StatusBar的状态更改 这里的上下文是GC.Spread.Sheets.Workbook的实例 |
void
▸ dispose(): void
处置StatusBar并解除所有事件的绑定
代码示例
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.dispose();
void
▸ get(itemName
): StatusItem
通过项名称获取项
代码示例
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);
属性名 | 类型 |
---|---|
itemName |
string |
指定itemName的StatusItem
▸ remove(itemName
): boolean
从状态栏中删除该项
代码示例
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);
// 做一些事请
statusBar.remove(spanItemName);
属性名 | 类型 | 说明 |
---|---|---|
itemName |
string |
StatusItem的名称 |
boolean
如果为true表示删除成功,否则为失败
▸ unbind(): void
取消绑定StatusBar的上下文
代码示例
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.unbind();
void
▸ update(): void
更新状态栏
代码示例
let spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"));
let statusBar = new GC.Spread.Sheets.StatusBar.StatusBar(document.getElementById('statusBar'));
statusBar.update();
void