DimViewOptionsDialog.getCurrentState

Syntax

getCurrentState();

Description

The getCurrentState method returns the current state for properties of the dialog box for setting up dimensions layout.

Comments

The method returns a JSON object which includes a field named "it", that is, an array of objects that contain data of the current dimension.

Example

Executing the example requires that the HTML page contains the DimViewOptionsDialog component named dimViewOptionsDialog (see Example of Creating the DimViewOptionsDialog Component).  Get dimensions names in the dialog box for setting up dimensions layout:

// Get the current state of properties of the dialog for dimension layout setup
var state = dimViewOptionsDialog.getCurrentState();
// Get a list of dimensions
var dims = state.dims.its.it;
var strDims = "";
for(var i = 0; i < dims.length; i++) {
    // Get dimension names
    strDims += state.dims.its.it[i].n;
    if (i != dims.length - 1) {
         strDims += ", ";
    }
}
// Output name of the current dimension in the dialog 
console.log("Dimension names: " + strDims);

After executing the example the browser console displays name of the current dimension in the dialog box for setting up dimensions layout:

Dimension names: Calendar, Calendar, Territories, Data Types, Socio Economic Indicators, and Facts

See also:

DimViewOptionsDialog