Skip to main content

The Custom Collection component for Retool Mobile

A repeatable set 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.

events

A list of configured event handlers that trigger actions or queries.

Type array
Array values object
Mutability
ControlUsage
Retool UI Inspector > Interaction > Event handlers
Array Object Properties

event

The event that triggers the action. Refer to the events section for details of available events for this object.

Type string
Mutability
ControlUsage
Retool UI Inspector > Interaction > Event handlers > Event

method

The JavaScript method to perform when type is datasource, widget, state, or localStorage.

Type string
Mutability
ControlUsage
Retool UI Inspector > Interaction > Event handlers > Edit event handler > Run script actions

type

The type of action to perform.

Type string
Mutability
ControlUsage
Retool UI Inspector > Interaction > Event handlers > Edit event handler > Action
Allowed Values
ValueDescription
datasource

Control query.

widget

Control component.

script

Run script.

state

Set variable.

localStorage

Set localStorage.

util

Perform utility action (e.g., Open URL or Confetti).



hidden

Whether this object is hidden from view.

Type boolean
Format True/False
Mutability
ControlUsage
Retool UI Inspector > Appearance > Hidden
MethodsetHidden()
Default
false
Examples
true

numRows

The number of rows displayed.

Type number
Mutability Read-only

pageSize

The number of rows per page.

Type number
Mutability Read-only

pagination

The pagination state.

Type object
Mutability
ControlUsage
Retool UI Inspector > Content > Add-ons > Pagination
Object Properties

afterCursor

The cursor to reference in a request for the next set of data.

Type string
Format Plain Text
Mutability Read-only
Examples
"eyJ0eXBlIjoiZm9vIiwic3RhdHVzIjoiYmFyIn0="

beforeCursor

The cursor to reference in a request for the previous set of data.

Type string
Mutability Read-only

currentPage

The currently selected page.

Type string
Format Plain Text
Mutability Read-only
Examples
"page1"

offset

The page offset.

Type number
Mutability Read-only

pageSize

The number of rows per page.

Type number
Mutability Read-only

selectedPageIndex

The selected page, by index.

Type number
Mutability Read-only

serverPaginated

Whether the data is paginated on the server.

Type boolean
Format True/False
Mutability Read-only
Examples
true

serverPaginationType

The type of server-side pagination in use.

Type string
Mutability
ControlUsage
Retool UI Inspector
Allowed Values
ValueDescription
limitOffsetBased

Limit offset based.

cursorBased

GraphQL Relay cursor based.



primaryKey

The primary key with which to identify records.

Type string
Mutability
ControlUsage
Retool UI Inspector > Content > Primary key

selectedPageIndex

The selected page, by index.

Type number
Mutability Read-only

Methods

JavaScript API methods for this object. You can write JavaScript almost anywhere in Retool and use methods to manipulate data and property values.

customCollection.setHidden()

Set the hidden value to toggle whether the component is visible. Defaults to true without a parameter.

Definition
customCollection.setHidden(hidden)
Parameters

hidden

Whether this object is hidden from view.

Type boolean
Format True/False
Default
false
Examples
true

Examples

Hide customCollection.

customCollection.setHidden(true);

Unhide customCollection.

customCollection.setHidden(false);

customCollection.setSelectedPageIndex()

Set the selected page index.

Definition
customCollection.setSelectedPageIndex(index)
Parameters

index

The index of an item.

Type number


Events

Events triggered by user interactions. You can configure event handlers in the IDE to trigger queries or other actions in response to events.

EventDescription
PressAn item is pressed.