Example of Creating the RollbackRevisionDlg Component

To execute the example, the HTML page must contain the WorkbookBox component named workbookBox (see Example of Creating the WorkbookBox Component). Create the RollbackRevisionDlg component and process clicking the Rollback button, showing dialog box comment text to the browser console:

// Get workbook properties panel
var propertyBar = workbookBox.getPropertyBarView();
// Get workbook data source
var source = propertyBar.getSource();
// Get workbook metadata
var metadata = source.getWbkMetadata();
// Get the first time series database
var rubr = metadata.rubrs.its.it[0];
// Determine time series database key
var rubKey = rubr.k;
// Create a dialog for revision rollback
var rollbackRevisionDialog = new PP.TS.Ui.RollbackRevisionDlg({
    OkButtonClicked: function () {
        console.log("Comment: " + rollbackRevisionDialog.getComment());
    },
    RubName: rubr.n // Time series database
});
// Display the created dialog
rollbackRevisionDialog.show();

After executing the example the RollbackRevisionDlg component is created:

After clicking the Rollback button the browser console displays text of the comment for created dialog box:

Comment: 11.02.2013

See also:

RollbackRevisionDlg