setSelectedEls (els);
els. Array of selected elements.
The setSelectedEls method sets array of selected dimension elements.
Dimension elements must be specified as metadata with the s field set to True, for example: { k: "YEARS:2003", s: True }
To execute the example, the HTML page must contain the DimensionTree component named dimTree (see Example of Creating the DimensionTree Component). The source dictionary must include elements with the following keys: YEARS:2002, YEARS:2003, YEARS:2004. Select these elements:
//Get dimension source
dim = dimTree.getSource();
//Determine array of selected elements
dim.setSelectedEls([{
k: "YEARS:2002",
s: True
}, {
k: "YEARS:2003",
s: True
}, {
k: "YEARS:2004",
s: True
}]);
//Refresh selection in the tree
dimTree.refreshSelection();
After executing the example elements with specified keys are selected in the tree:
See also: