Main Content
setSelectedItems
Set values for a tree
Syntax
treeControl.setSelectedItems({'Node1/ChildNode1','Node1/ChildNode2'})
Description
set
the values for the selected items in the tree.treeControl
.setSelectedItems({'Node1/ChildNode1','Node1/ChildNode2'})
Input Arguments
Examples
Create Tree Dialog Control
Use tree dialog control to create an interactive, hierarchical structure for selecting parameters or options within a mask.
Explore the Model
This model has a subsystem block named TreeControl
. It has a tree dialog control parameter TreeControl
with data.
open_system("slexMaskDialogControlExamples.slx");
Create and Insert Data into Tree Dialog Control
To create a tree dialog control:
1. Create a mask on the block TreeControl
.
maskObj=Simulink.Mask.get('slexMaskDialogControlExamples/TreeControl');
2. Crete a tree dialog control.
treeControl=maskObj.getDialogControl('Control2');
3. Insert data into the tree dialog control.
treeControl = maskObj.getDialogControl('Control2'); treeControl.setSelectedItems({'Node1/ChildNode1','Node1/ChildNode2'})
Version History
Introduced in R2019b