Workbook.DimsObs

Syntax

DimsObs: Array;

Description

The DimsObs property sets dimensions for workbook observation attributes that refer to dictionaries.

Comments

Use JSON or the setDimsObs method to set the property value, and the getDimsObs method to get the property value.

The property contains an array of objects of the PP.Mb.DimSource type.

The following parameters are specified on calling the setDimsObs method: value - dimension presented by the object of the PP.Mb.DimSource type, key - dimension key.

On calling the getDimsObs method define the parameter key - dimension key.

Example

To execute the example, the HTML page must contain the WorkbookBox component named workbookBox (see Example of Creating the WorkbookBox Component). The data source must contain two dictionaries with the keys 1646 and 1830, observation attribute named Countries with the Dictionary reference type, and with a reference to 1830 dictionary (attributes can be edited only in desktop application).

Before executing the example the Observation Attributes panel contains a drop-down list that shows elements of the dictionary with the 1830 key:

Load elements of the 1646 dictionary to this list:

// Get workbook instance
var wbkDocument = workbookBox.getSource();
// Get workbook data model
var workbook = wbkDocument.getActiveSheet();
// Get workbook metadata
var metadata = wbkDocument.getMetabase();
// Create dimension service
var dimService = new PP.Mb.DimService({
    Metabase: metabase
});
// Get dimensions with the 1646 key
var dim = dimService.open(1646);
/* Set dimension with the 1646 key for observation attribute 
that refers to the dimension with the 1830 key */
workbook.setDimsObs(dim, 1830);
// Refresh workbook
workbookBox.refreshAll();

After executing the example elements of the dictionary with the 1646 key are loaded to drop-down list shown in the Observation Attributes workbook panel:

See also:

Workbook