parse (elems);
elems. Array of dimension elements.
The parse method converts an array of dimension elements to array of selection elements.
To execute the example, the HTML page must contain the ExpressBox component named expressBox (see Example of Creating the ExpressBox Component). The express report must include dimension with the index 4, that contains an element with the key 1. The dimension element with the key 1 must have children (the node with the key 1 must be open in dimensions tree in the Selection tab of the side panel). Set a collection of dimension elements selections for the express report, get selection with the index 4, set selection for dimension element with the index 1 and its children:
var eaxAnalyzer = expressBox.getSource(); // Determine a set of dimension element selections for express report eaxAnalyzer.setDimSelectionFilterSet(new PP.Mb.DimSelectionSet({ OdId: eaxAnalyzer.getDimFilterOdId(), // Moniker CorrelatedDims: eaxAnalyzer.getDims() // Array of dimensions }));//Get a set of report's dimension element selections dimSet = eaxAnalyzer.getDimSelectionFilterSet(); //Get selection with the 4 index dimSel = dimSet.getItems()[4]; //Get dimension dim = dimSel.getDimension(); //Get array of child elements of the dimension element with the 1 index elems = dim.getChildEls(1); console.log("Number of selection elements before: " + dimSel.getElements().length); //Add array of elements to the selection dimSel.parse(elems); console.log("Number of selection elements after: " + dimSel.getElements().length);
After executing the example children of the dimension element with the key 1 are added to selection. The following information is shown in the browser console:
Number of selection elements before: 0
Number of selection elements after: 5
See also: