setSource (value);
value. Sets workbook, an instance of the Workbook class.
The setSource method specifies the workbook to display its data in the component.
To execute the example, the page must contain the WorkbookBox component named workbookBox (see Example of Creating the WorkbookBox Component), and also add the following code in the handler, that processes document opening event:
var mainSeriesPanel = workbookBox.getPropertyBarView().getMainSeriesPanel(); var updateViewAsMenuButt = new PP.Ui.Button({ ParentNode: document.body, //DOM parent node Content: "Remove source", //Text Click: PP.Delegate(onClickUpdateViewAsMenu) }); function onClickUpdateViewAsMenu() { mainSeriesPanel._Source ? mainSeriesPanel.setSource(null) : mainSeriesPanel.setSource(wbk); mainSeriesPanel._Source ? updateViewAsMenuButt.setContent("Remove source") : updateViewAsMenuButt.setContent("Set source") }
After executing the example a button named Remove Source is placed in the HTML page. Open the Primary panel in the side panel Series tab. On clicking the button data source is set or removed for the transformations setup wizard in the Primary panel. If a source is set, the button is named Remove Source, if no source is defined, the button label says Set Source. If the source is set, on selecting workbook series the Change Default Name section of the Primary panel shows name of the selected series. If no source is set, on selecting another series name in the change Default Name section does not change.
See also: