TransformDialogLeftPanel.getOpenedDataSources

Syntax

getOpenedDataSources();

Description

The getOpenedDataSources method returns an object with information about opened data sources, from which dimension element data is extracted.

Example

To execute the example, the HTML page must contain the TransformDialog component named dialog (see Example of Creating the TransformDialog Component). Get a name of changed dimension element:

// Get an array of opened data sources
var sources = dialog._LeftPanel.getOpenedDataSources();
if(sources.length  0) {
    // Get a loaded dimension element
    var expr = dialog._LeftPanel.getSummaryExpression(True);
    // Get a name of changed dimension element
    var source = sources[0];
    for (var i in source.Dims) {
        if (source.Dims[i].getId() === expr.Expr.Formula[1].n) {
            console.log("Name of changed dimension element: " + 
                source.Dims[i].getElem(expr.Expr.Formula[1].v).n);
        }
    }
} else {
    console.log("No opened data sources");
}

As a result the console displays name of the opened data source:

Name of changed data source: GROSS REGIONAL PRODUCT

See also:

TransformDialogLeftPanel