Rub: Object;
The Rub property specifies time series database used as the workbook source.
The Rub property is an object that contains information on the time series database, used to create the workbook.
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 addSerieButton = new PP.Ui.Button({
ParentNode: document.body, //DOM parent node
Content: "Add Series", //Text
Click: PP.Delegate(onClickAddSerie)
});
function onClickAddSerie()
{
var source = wbk.getActiveSheet();
//To set period, equal the start and end periods
source.getWbkMetadata().period.start = source.getWbkMetadata().period.end;
//Get time series database
var rub = wbk.getRub();
//Set start and end periods
rub.meta.period.endYear = 1991;
rub.meta.period.startYear = 1990;
//Get index of the series to be added
var index = wbk.getActiveSheet().getSeries().length;
//Add series to workbook.
tsService.addWbkSeries(source, source.getHier(), undefined, {"Index": index, "PeriodLvl": "Month"}, PP.Delegate(onResponse));
}
function onResponse()
{
//Refresh entire component for displaying workbook
workbookBox.refreshAll();
}
After executing the example a button named Add Series is placed on the HTML page. Clicking this button adds a series to the workbook and sets display period from 1990 to 1991.
See also: