RevisionsPanel.Source

Syntax

Source: PP.TS.WbkDocument;

Description

The Source property returns the workbook data of which is shown in the component.

Example

To execute the example, the page must contain the WorkbookBox component named workbookBox (see Example of Creating the WorkbookBox Component), the time series database with the 112 key, and the following code must be added in the document opening event handler:

	var sourceButt = new PP.Ui.Button({
		ParentNode: document.body, //DOM parent node
		Content: "Source", //Text
		Click: PP.Delegate(onClickSource)
		});
	function onClickSource()
	{
     //Get TSDB key
     var rubKey = wbk.getActiveSheet().getRub().meta.obInst.obDesc.k;
     //Get workbook properties panel
     var wbkPB = workbookBox.getPropertyBarView();
     //Get array of elements located on the statistics panel
     var panels = wbkPB._selfNavItems;
     var revisionsPanel = null;
     var i;
     //Select revisions panel from the array of elements located on the statistics panel
     for (i = 0; i < panels.length; i++)
     {
      if (panels[i]._GroupName == PP.TS.Ui.PropertyGroups.RubricatorRevisions && panels[i].getTag() == rubKey)
      {
       revisionsPanel = wbkPB._selfNavItems[i];
       break;
      }
     }
     //Depending on whether the set data source exists, set or remove data source
     if(revisionsPanel.getSource())
     {
      revisionsPanel.setSource(null);
      sourceButt.setContent("Source is not set")
     }
     else
     {
      revisionsPanel.setSource(wbk);
      sourceButt.setContent("Source is set")
     }
    }

After executing the example the WorkbookBox component and a button named Source are placed in the HTML page. To execute the example, select the Data tab in the workbook side panel. Switch to the panel, whose name matches name of time series database, select an available revision and click the Source button. The Source Set label shown on the button indicates that a data source is currently set for the time series database revisions panel. On selecting an available revision and clicking the Rollback button in the panel, the following window appears in the screen:

This indicates that a data source is set for time series database revisions panel.

If the button label says Source is not Defined, nothing appears in the screen on selecting an available revision and clicking the Rollback panel button. This means that no data source is set for the time series database revisions panel.

See also:

RevisionsPanel