ListSelector Component Referencetml`
<ListSelector />
`
The ListSelector component is a Selector component that renders a <ul> with a list of selectable items. The items may have one level of sub-items, in which case the list expands to show the sub-items when selected ("accordions"). Only one group of sub-tiem can be expanded at one time. If another group is selected, the previous one collapses.
If the ListSelector component has a timeout attribute, an expanded group will automatically collapse after the specified amount of time.
ListSelector component accepts the standard attributes.onClickfn(value) where value is the value associated with the selected option. The displayed list reflects the newly selected option. The function may subsequently override the selection by setting calling the setValue() method if required.optionsoptionsoptions property, it must contain an array containing strings, numbers, or objects containing both a text property and a value property.texttext is omitted, then value coerced to a string is used.value The value of the state variable if this option is selected.
If an element is a number, the displayed text is the number coerced to a string, and the value is the element. If an element is a string, it is used for both the displayed text and value.
valueoptions array.showSelectiontimeouttimeout milliseconds.valueThese methods are intended to be used by parent components to dynamically change the properties of the rendered components without re-rendering.
setValue()setValue(value)
Sets the rendered element's value.
valueThe ListSelector component ignores any children.
ListSelector component renders a <ul> elemment containing a <li> element for each option.ListSelector component <ul> element has a CSS class string that contains listSelector.<li> element is rendered for each option. Each <li> element has a CSS class string that contains listSelector_item.<li> element will have a CSS class string that contains listSelector_item-sel. The other will have listSelector_item-unsel.