WbkToolBarView.getItems

Syntax

getItems();

Description

The getItems method returns array of the WbkToolBar component buttons.

Comments

The method returns an array of object of the PP.Ui.ToolBarButton.

Example

To execute the example, the HTML page must contain the WorkbookBox component named workbookBox (see Example of Creating the WorkbookBox Component). Show names of the WbkToolBar component buttons, and show information about Map view state:

// Get toolbar for controlling visibility of workbook views
var toolBarView = workbookBox.getDataView().getToolBarView();
// Get array of toolbar buttons for controlling visibility of workbook views
var items = toolBarView.getItems();
// Output button names
for (var i = 0; i < items.length; i++) {
   console.log("Button name: " + items[i].getContent())
}
// Get state of toolbar for controlling visibility of workbook views
var state = toolBarView.getToolBarState();
// Output information about state of the Map view
console.log("Indicates whether the Map view is active: " + state.map.enabled);
console.log("Indicates whether the Map view is active: " + state.map.visible);

After executing the example the browser console displays names of views' buttons, and current state of the Map view:

Button name: Table

Button name: Chart

Button name: Map

Is the Map view active: True

Is the Map view visible: False

See also:

WbkToolBarView