WbkToolBarView.Source

Syntax

Source: PP.TS.WbkDocument;

Description

The Source property sets a data source for the WbkToolBar component.

Comments

Property value can be set from JSON or using the setSource method, property value is returned by the getSource method.

Example

To execute the example, the HTML page must contain the WorkbookBox component named workbookBox (see Example of Creating the WorkbookBox Component). Get key of the data source for the toolbar that manages workbook views visibility:

// Get toolbar for controlling visibility of workbook view
var toolBarView = workbookBox.getDataView().getToolBarView();
// Set a data source for this toolbar if it is missing
var source = toolBarView.getSource(); // Get data source
if (source == null | source == undefined) {
    toolBarView.setSource(workbookBox.getSource());
    console.log("Data source key: " + workbookBox.getSource().getKey());
} else {
    console.log("Data source key: " + source.getKey());
};

After executing the example the browser console displays key of the data source for toolbar that manages workbook views visibility:

Data source key: 2944

See also:

WbkToolBarView