editSeries (wbk, series, callback, expanding, grouping, args);
wbk. Sets workbook.
series. Sets series array
callback. Sets handler for operation execution end.
expanding. Indicates if series expander state is changed.
grouping. Indicates if series grouping is changed.
args. Sets arguments containing metadata.
The editSeries method changes series value.
The expanding parameter may take the following values:
True - expander unfolds.
False - expander collapses.
undefined - expander state does not change.
The parameter may take the following values:
True - series are grouped.
False - grouping is canceled.
undefined - grouping does not change.
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 editSeriesButt = new PP.Ui.Button({ ParentNode: document.body, //DOM parent node Content: "Rollback Revision", //Text Click: PP.Delegate(onClickEditSeries) }); var serie; function onClickEditSeries(){ serie = wbk.getSelectedSeries()[0]; //Get series revisions tsService.getSerieRevisions(wbk, serie, PP.Delegate(onResponse)); } function onResponse(sender, args) { var revs = args.Revs; //Get keys of the last and one but the last revisions var lastRevKey = PP.Mb.UINT32MAXVALUE; var prevRevKey = revs[revs.length - 2].k; serie.atts = { its: { it: []} }; //Set revision key for series if (serie.calc.revKey == PP.Mb.UINT32MAXVALUE) { serie.calc.revKey = prevRevKey; } else { serie.calc.revKey = PP.Mb.UINT32MAXVALUE; } series = [serie]; //Change series tsService.editSeries(wbk, series, PP.Delegate(function() { //Refresh workbook display workbookBox.refreshAll(); })); }
After executing the example the WorkbookBox component and the button named Rollback Revision are placed on the HTML page. Change values of one or several cells, next save the changes using the Save Changes button in the Data ribbon tab. In the dialog box that opens click the OK button. Thus we add a revision to series. After that select the changed series. On clicking the button new values are replaced with previous ones.
See also: