[]
        
(Showing Draft Content)

GC.Spread.Sheets.StatusBar.StatusBar

Class: StatusBar

Sheets.StatusBar.StatusBar

Table of contents

Constructors

Methods

Constructors

constructor

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'})]});

Parameters

Name Type Description
host HTMLElement The DOM Element.
options? IStatusBarOptions -

Methods

add

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);

Parameters

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.

Returns

boolean

Add item result. If add success return true, else failed.


all

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]);

Returns

StatusItem[]

The item list on statusbar.


bind

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);

Parameters

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.

Returns

void


dispose

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();

Returns

void


get

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);

Parameters

Name Type
itemName string

Returns

StatusItem

The StatusItem whose itemName is specified.


remove

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);

Parameters

Name Type Description
itemName string The name of the StatusItem.

Returns

boolean

If true means remove success, else failed.


unbind

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();

Returns

void


update

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();

Returns

void