getEls(dim: PP.Mb.DimSource, parent: String, elsFilter: String, elsPattern: String, listRange: Object, callback: Function | PP.Delegate, errCallback: Function | PP.Delegate);
dim. Dictionary.
parent. Key of the parent element.
elsFilter. Element filter.
elsPattern. A pattern, according to which elements are extracted.
listRange. Range of elements.
callback. Callback function.
errorCallback. Callback function on error.
The getEls method is used to get dictionary elements by passed parameters.
Executing the example requires an instance of the DimSrv class named dimService (see DimSrv constructor). Get child elements of the element with the YEARS:2002 key:
// Get child elements of the element with the YEARS:2002 key var func = function(sender, args) { var res = JSON.parse(args.ResponseText); var elems = res.GetDimElementsResult.els.e; console.log("Child elements:"); for (var i in elems) { elems[i].n.indexOf("quarter") != -1 ? console.log(elems[i].n) : null; } } dimService.getEls(dim, "YEARS:2002", null, null, null, func);
As a result the console displays child elements of the element with the YEARS:2002 key:
Child items:
I quarter 2002
II quarter 2002
III quarter 2002
IV quarter 2002
See also: