Skip to main content

The Custom Collection component for Retool Mobile

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
Configurability Inspector > Interaction > Event handlers
Defaultnull
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
Configurability Inspector > Interaction > Event handlers > Event
Defaultnull

method​

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

Type string
Configurability Inspector > Interaction > Event handlers > Edit event handler > Run script actions
Defaultnull

type​

The type of action to perform.

Type string
Configurability 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).

Defaultnull


hidden​

Whether this object is hidden from view.

Type boolean
Format True/False
Configurability Inspector > Appearance > Hidden
Defaultfalse
Examples
falsetrue

numRows​

The number of rows displayed.

Type number
Configurability Read-only
Defaultnull

pageSize​

The number of rows per page.

Type number
Configurability Read-only
Defaultnull

pagination​

The pagination state.

Type object
Configurability Inspector > Content > Add-ons > Pagination
Defaultnull
Object Properties

afterCursor​

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

Type string
Format Plain Text
Configurability Read-only
Defaultnull
Examples
false"eyJ0eXBlIjoiZm9vIiwic3RhdHVzIjoiYmFyIn0="

beforeCursor​

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

Type string
Configurability Read-only
Defaultnull

currentPage​

The currently selected page.

Type string
Format Plain Text
Configurability Read-only
Defaultnull
Examples
false"page1"

offset​

The page offset.

Type number
Configurability Read-only
Defaultnull

pageSize​

The number of rows per page.

Type number
Configurability Read-only
Defaultnull

selectedPageIndex​

The selected page, by index.

Type number
Configurability Read-only
Defaultnull

serverPaginated​

Whether the data is paginated on the server.

Type boolean
Format True/False
Configurability Read-only
Defaultnull
Examples
falsetrue

serverPaginationType​

The type of server-side pagination in use.

Type string
Configurability Inspector
Allowed Values
ValueDescription
limitOffsetBased

Limit offset based.

cursorBased

GraphQL Relay cursor based.

Defaultnull


primaryKey​

The primary key with which to identify records.

Type string
Configurability Inspector > Content > Primary key
Defaultnull

selectedPageIndex​

The selected page, by index.

Type number
Configurability Read-only
Defaultnull

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.