SpliceTabSheetDataSource.getData

Syntax

getData();

Description

The getData method returns information on the table of spliced time series.

Comments

This method returns a JSON object with the following fields: dependentSeries - array of object that contain keys of time series specified in the table, selectionTimeRanges - array of selected time ranges with specified start time (endDate property) and end time (endDate property).

Example

To execute the example, the HTML page must contain the WorkbookBox component named workbookBox (see Example of Creating the WorkbookBox Component). Add two rows to table of spliced time series, and link one of these rows to the first time series:

// Get workbook properties panel
var propertyBar = workbookBox.getPropertyBarView();
// Get parameters panel
var parametersPanel = propertyBar.getParametersPanel();
// Display this panel
parametersPanel.show();
// Expand the panel
parametersPanel.expand();
// Get time series splice setup wizard 
var spliceMethodWizard = parametersPanel._SpliceMethodWizard;
// Display this wizard 
spliceMethodWizard.show();
// Get table data source for the specified wizard
var tabSheetDS = spliceMethodWizard._DataSource;
// Add two rows to the table
tabSheetDS.addRow();
tabSheetDS.addRow();
// Get the first series and set it for the first table row that is not a title
var serie = workbookBox.getSource().getSeries()[0];
tabSheetDS._Cells[5].CellData.FT = serie.n;
tabSheetDS._Cells[5].CellData.V = serie.k;
// Refresh the table
spliceMethodWizard._TabSheet.update();
// Get information about the rows linked to time series
var fillRowsCounter = 0; // Rows counter with the specified time series
var rowsCounter = 0; // All table rows counter
while (fillRowsCounter < tabSheetDS.getFillRowsCount()) {
    if (tabSheetDS.getIsRowFilled(rowsCounter)) {
        var data = tabSheetDS.getData();
        console.log("Key of the specified time series: " + data.dependentSeries[fillRowsCounter].k);
        fillRowsCounter++;
    }
    rowsCounter++;
};

After executing the example two rows are added to the table. The first time series is set for the first of these rows:

The browser console displays keys of all time series specified in splice table:

Key of specified time series: 2

See also:

SpliceTabSheetDataSource