MetaSource.getElem

Syntax

getElem(key: String, filter: PP.Mb.ElsFilter, odId: Object);

Parameters

key. Returned element key. If the parameter is not defined, the data source root element is returned.

filter. Filter, to which elements satisfy.

odId. Dimension moniker.

Description

The getElem method returns model element by its key.

Example

To execute the example, the HTML page must contain the MetaTree component named metaTree (see MetaTree Constructor). Check if model has all required metadata for work and get name of the first model child element:

// Get metadata tree model
var metaSource = metaTree.getSource();
// Check if model contains all required data
if (metaSource.isMdLoaded()) {
    console.log("Model contains all required data");
} else {
    console.log("Model does not contain all data");
}
// Get name of the first model child element
console.log("Name of the first model child element: " + metaSource.getElem().children[0].n);

As a result the console displays check result and name of the first model child element:

Model contains all required data

Name of the first model child element: express1

See also:

MetaSource