The List View component for Retool Apps
A repeatable list of components with values that map to a list of data.
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.
data
The data.
Type | string | number | boolean | object | array | ||||||
Format | Custom data | ||||||
Mutability |
|
direction
The layout of content.
Type | string | ||||||
Mutability |
| ||||||
Allowed Values |
|
enableInstanceValues
Whether to enable instance values. When true
, descendent values are evaluated with a formDataKey
property for all instances, including those that haven't been evaluated yet due to virtualization. These values are aggregated on the instanceValues
property.
Type | boolean | ||||
Mutability |
|
formDataKey
The key used by a Form component to assign default values to input fields using form.initialData
, and to construct the form.data
property.
Type | string | ||||
Format | Plain Text | ||||
Mutability |
| ||||
Default |
|
Examples
table1.selectedRow.id
heightType
Whether List View height automatically adjusts to fit content or is a fixed size.
Type | string | ||||||||
Format | Plain Text | ||||||||
Mutability |
| ||||||||
Allowed Values |
| ||||||||
Default |
|
hidden
Whether this object is hidden from view.
Type | boolean | ||||||
Format | True/False | ||||||
Mutability |
| ||||||
Default |
|
Examples
true
id
The unique identifier (name).
Type | string | ||||
Format | Plain Text | ||||
Mutability |
| ||||
Default |
|
Examples
query1
button1
isHiddenOnDesktop
Whether to show or hide this object in the desktop layout.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
isHiddenOnMobile
Whether to show or hide this object in the mobile layout.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
maintainSpaceWhenHidden
Whether to take up space on the canvas if hidden
is true
.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
margin
The amount of margin to render outside.
Type | string | |||||||||
Format | Plain Text | |||||||||
Mutability |
| |||||||||
Allowed Values |
| |||||||||
Default |
|
Examples
4px 8px
overflowType
The overflow behavior when the contents exceeds the height.
Type | string | ||||||
Mutability |
| ||||||
Allowed Values |
|
padding
The amount of padding to render inside.
Type | string | ||||||
Format | Plain Text | ||||||
Mutability |
| ||||||
Allowed Values |
| ||||||
Default |
|
Examples
4px 8px
primaryKeyFieldNameOverride
The primary key to use.
Type | string | ||||
Mutability |
|
showInEditor
Whether the component remains visible in the editor if hidden
is true
.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
style
Custom style options.
Type | object | ||||
Mutability |
|
Methods
JavaScript API methods for this object. You can write JavaScript almost anywhere in Retool and use methods to manipulate data and property values.
listView.clearInstanceValues()
Examples
Clear the instance values from listView
.
listView.clearInstanceValues();
listView.scrollIntoView()
Scrolls the canvas or parent container so that the selected component appears in the visible area.
listView.scrollIntoView(options)
Parameters
Object Properties
behavior
The scroll behavior.
Type | string | ||||||
Allowed Values |
|
block
The scroll position relative to the component.
Type | string | ||||||||||
Allowed Values |
|
Examples
Scroll the minimum amount to immediately bring listView
into view.
listView.scrollIntoView({behavior: 'auto', block: 'nearest'});
listView.scrollToIndex(index)
listView.setHidden()
Set the hidden
value to toggle whether the component is visible. Defaults to true
without a parameter.
listView.setHidden(hidden)
Parameters
Examples
true
Examples
Hide listView
.
listView.setHidden(true);
Unhide listView
.
listView.setHidden(false);
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 |
---|