Source: PP.TS.WbkDocument;
The Source property determines data source for tool ribbon.
To execute the example, the page must contain the WorkbookBox component named workbookBox (see Example of Creating the WorkbookBox Component), the repository must include a workbook with the 5183 key, and the following code must be added in the document opening event handler:
var NewKEY = 5183; tsService.openDocument(NewKEY, onSecondOpened); function onSecondOpened(sender, args) { //Get a new data source var wbk2 = args.Workbook; //Set the selected series in the new data source tsService.setSelectedSeries(wbk2, [1], [0]); var setSourceButt = new PP.Ui.Button({ ParentNode: document.body, //DOM parent node Content: "Source", //Text Click: PP.Delegate(onClickSetSource) }); function onClickSetSource(){ //Get component used to display menu of the Ribbon type var ribbonView = workbookBox.getRibbonView(); //Set new source ribbonView.Source = wbk2; //Refresh component ribbonView.refreshAll(); } }
After executing the example the workbook with the 5183 key opens in the HTML page, and the Source button is placed in the page. Clicking this button refreshes the ribbon contents in accordance with the new source (5183 workbook).
See also: