setSelectedElems (value, keys, fireEvent)
value. Indicates if the element is selected. If the parameter is set to True the element is selected, otherwise the element will be deselected.
keys. Array that contains keys of dimension elements] to be selected.
fireEvent. Determines whether to fire the RequestSelection event after method execution.
The setSelectedElems method selects specified dictionary items.
To execute the example, the page must contain a DimTree component named dimTree (see Example of Creating the DimTree Component). Tree source is the dimension dim. Add a handler of the DimTreeView.RequestChild event:
dimTree.RequestChild.add(function (sender, args)
{
dimTree.setSelectedElems(true, ['3', '4'], true);
console.log("shortcut: " + dim.getIsShortcut() + "; parent key: " + dim.getParentKey() + "; name: " + dim.getName(), dim.getState(), dim.getMetadata())
})
After executing the example on calling children (on the first click on a node that contains children), dictionary elements with specified keys are selected and the browser console shows information about the dictionary used as the tree data source.
See also: