Here's our tree data:
[{
label: 'Hats',
children: [
{label: 'Flat cap'},
{label: 'Fedora'},
{label: 'Baseball', selected: true},
{label: 'Top hat'},
{label: 'Gatsby', selected: false}
]
}]
Note that only the "Baseball" and "Gatsby" nodes have specified a selected state.
Validate on startup disabled.
Incoming selections are used as is. Note that there will be no indeterminate checkboxes.
Validation with default state being true
.
Nodes without a selected
property are assumed to be selected if a parent does not have selected:false
and all their children can be considered selected.
Validation with default state being false
. Similar to the case above.