getAddSeriesSettings (wbk, series, isFolder, isGroup);
wbk. Sets workbook.
series. Sets an array of workbook series.
isFolder. Indicates that a folder is added.
isGroup. Indicates that a group is added; only the first series in the group and group number are specified.
The getAddSeriesSettings method returns body of a request to add series to a 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 getSeriesSettingsButt = new PP.Ui.Button({ ParentNode: document.body, //DOM parent node Content: "Add a Series", //Text Click: PP.Delegate(onClickGetAddSeriesSettings) }); function onClickGetAddSeriesSettings() { var source = workbookBox.getSource();//Return an instance of the PP.TS.WbkDocument class var series = []; var serie = {}; serie.k = "0"; serie.id = ""; serie.n = PP.resourceManager.getString("WbkNewSerie") + " " + tsService._NewSeriesCount; tsService._NewSeriesCount++; serie.vis = True; serie.kind = "Source"; serie.hint = ""; serie.calc = {}; serie.index = tsService._getMaxNonChildSerieIndex(wbk) + 1; if (source.getWbkMetadata().rubrs.def) serie.calc.rubKey = source.getWbkMetadata().rubrs.def.k; else serie.calc.rubKey = source.getHier().getMetadata().obInst.obDesc.k; series.push(serie); serie.atts = { its: { it: []} }; serie.level = "Month"; //Get body of request for adding series to workbook var body = tsService.getAddSeriesSettings(source, series, True); wbk.setIsChanged(True); tsService._invokeRemoteProc(source, body, function() { workbookBox.refreshAll(); }); }
After executing the example a button named Add Series is placed on the HTML page. On clicking this button a new series named New Series 1 is added to the table.
See also: