The Cascader component for Retool Apps
An input field to select options using a dropdown menu or manually enter a value in a multi-level tree structure.
Retool recently released this improved version of the Cascader component. Use of the legacy Cascader component is discouraged.
Properties
All properties for this object with supported data types or values. You can write JavaScript almost anywhere in Retool to manipulate or read property values.
captionByIndex
A list of captions for each item, by index.
Type | array |
Format | Plain Text |
Array values | string |
Mutability | Read-only |
Default |
|
Examples
checkedPathArray
The selected items, in nested order.
Type | array |
Array values | number |
Mutability | Read-only |
checkedPathStrings
The selected items, in strong format.
Type | array |
Array values | string |
Mutability | Read-only |
checkStrictly
Whether to check the treeNode
. Parent treeNode
and children treeNodes
are not included.
Type | boolean | ||||
Mutability |
|
delimiter
The delimiter used in checkedPathStrings
.
Type | string | ||||
Mutability |
|
deprecatedLabels
A list of labels for each item. Falls back to the corresponding value
if no label is provided.
Type | array |
Array values | string |
Mutability | Read-only |
Default |
|
Examples
disabled
Whether input, interaction, selection, or triggering is disabled.
Type | boolean | ||||||
Format | True/False | ||||||
Mutability |
| ||||||
Default |
|
Examples
disabledByIndex
A list of values for each item, by index, that reflect whether they are disabled.
Type | array |
Array values | boolean |
Mutability | Read-only |
Default |
|
Examples
disabledValues
A list of values not available for selection.
Type | array |
Array values | boolean |
Mutability | Read-only |
groupLayout
The layout of grouped items.
Type | string | |||||||||||||||
Mutability |
| |||||||||||||||
Allowed Values |
| |||||||||||||||
Default |
|
heightType
Whether the height automatically adjusts to fit content or is a fixed size.
Type | string | ||||||||
Format | Plain Text | ||||||||
Mutability |
| ||||||||
Allowed Values |
| ||||||||
Default |
|
hiddenByIndex
A list of items, by index, and whether they are hidden.
Type | array |
Array values | boolean |
Mutability | Read-only |
Default |
|
Examples
id
The unique identifier (name).
Type | string | ||||
Format | Plain Text | ||||
Mutability |
| ||||
Default |
|
Examples
isHiddenOnDesktop
Whether to show or hide this object in the desktop layout.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
isHiddenOnMobile
Whether to show or hide this object in the mobile layout.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
labelPosition
The position of the label relative to the input field or value.
Type | string | |||||||||
Format | Plain Text | |||||||||
Mutability |
| |||||||||
Allowed Values |
| |||||||||
Default |
|
Examples
labels
A list of labels for each item. Falls back to the corresponding value
if no label is provided.
Type | array |
Array values | string |
Mutability | Read-only |
Default |
|
Examples
leafPathStrings
A list of expanded keys in hyphen-separated format.
Type | array |
Array values | string |
Mutability | Read-only |
maintainSpaceWhenHidden
Whether to take up space on the canvas if hidden
is true
.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
margin
The amount of margin to render outside.
Type | string | |||||||||
Format | Plain Text | |||||||||
Mutability |
| |||||||||
Allowed Values |
| |||||||||
Default |
|
Examples
minColumnWidth
The minimum width of a column when using a multi-column layout.
Type | number | ||||
Format | number | ||||
Mutability |
| ||||
Default |
|
Examples
required
Whether a value is required to be selected.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
selectedIndexes
A list of selected values, by index.
Type | array |
Array values | number |
Mutability | Read-only |
Examples
selectedLabels
A list of labels for selected values, by index.
Type | array |
Array values | string |
Mutability | Read-only |
showInEditor
Whether the component remains visible in the editor if hidden
is true
.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
style
Custom style options.
Type | object | ||||
Mutability |
|
tooltipByIndex
A list of tooltips for each item, by index.
Type | array |
Array values | string |
Mutability | Read-only |
Default |
|
Examples
tooltipText
The tooltip text to display next to the label on hover.
Type | string | ||||
Format | Markdown | ||||
Mutability |
| ||||
Default |
|
Examples
Methods
JavaScript API methods for this object. You can write JavaScript almost anywhere in Retool and use methods to manipulate data and property values.
cascader.clearValidation()
Examples
cascader.resetValue()
Examples
cascader.scrollIntoView()
Scrolls the canvas or parent container so that the selected component appears in the visible area.
cascader.scrollIntoView(options)
Parameters
Examples
cascader.setDisabled()
Set the disabled
value to toggle whether the input field is disabled. Defaults to true
without a parameter.
cascader.setDisabled(disabled)
Parameters
Examples
cascader.setHidden()
Set the hidden
value to toggle whether the component is visible. Defaults to true
without a parameter.
cascader.setHidden(hidden)
Parameters
Examples
Events
Events triggered by user interactions. You can configure event handlers in the IDE to trigger queries or other actions in response to events.
Event | Description |
---|---|
Change | The value is changed. |