getElements ();
The getElements method returns the 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 a dimension with the key 1557, that contains an element with the key 1. Set dimension elements selection for the dimension 1557, get ID of the dimension that contains the selection, set selection for the dimension element with the key 1, and next remove selection from all the elements:
var eaxAnalyzer = expressBox.getSource().getActiveSheet(); //Get selection with the 4 index dimSel = new PP.Mb.DimSelection({DimSource: eaxAnalyzer.getDim(1557)}) //Get dimension to which belongs the selection dim = dimSel.getDimension(); //Display dimension identifier to the console console.log("Dimension ID: " + dim.getId()); //Add an element with the 1 key to the selection dimSel.selectElement(1); console.log("Number of selection elements before deselection: " + dimSel.getElements().length); // Deselect all selections from collection dimSel.deselectAll();
After executing the example the user gets ID of the dimension with the index 4, the dimension element with the key 1 is added to selection, and next selection is removed from all the elements. The following information is shown in the browser console:
Dimension ID: INDSTAT_COUNTRIES
Number of selection elements before removal: 1
Number of selection elements after removal: 0
See also: