DimSrv.getChildren

Syntax

getChildren(dim: PP.Mb.DimSource, args: Object, callback: Function | PP.Delegate, errorCallback: Function | PP.Delegate);

Parameters

dim. Dictionary.

args. Operation arguments. An object must contain the following fields: selId - selection moniker; parentKey - parent element key; range - range of elements; filter - filter of elements; fireEvent - indicates if the DimSrv.ChildLoaded event is called; if the parameters is set to True, the event is called.

callback. Callback function.

errorCallback. Callback function on error.

Description

The getChildren method loads child elements by specified parameters.

Example

Executing the example requires an instance of the DimSrv class named dimService (see DimSrv Constructor). Add a handler for child element loading event. Get child elements of the element with the YEARS:2003 key:

// Add a handler of event of loading dimension object child elements
dimService.ChildLoaded.add(function(sender, args) {
    console.log("Child elements are loaded");
});
// Get names of child element of the object with the YEARS:2003 key
var args = {
    parentKey: "YEARS:2003"
};
var func = function(sender, args) {
    var res = JSON.parse(args.ResponseText);
    var elems = res.GetDimElementsResult.els.e;
    console.log("Names of child elements:");
    for (var i in elems) {
        console.log(elems[i].n);
    }
};
dimService.getChildren(dim, args, func);

As a result the console displays the number of all dictionary elements:

Child elements are loaded

Names of child elements:

I quarter of 2003

II quarter of 2003

III quarter of 2003

IV quarter of 2003

See also:

DimSrv