Skip to main content

The Calendar component for Retool Apps

A content area to display calendar events.

Calendar uses the FullCalendar library.

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.

changeSet

Edited values for each row.

Type array
Format Custom data
Array values object
Configurability Read-only
Defaultnull

colorByIndex

A list of colors for each item, by index.

Type array
Array values string
Configurability Read-only
Defaultnull

data

The data.

Type string | number | boolean | object | array
Format Custom data
Configurability Inspector
Defaultnull

dayMaxEvents

The maximum number of events to display, per day, when viewType is month. If not set, events stack to the height of the cell.

Type number
Configurability Inspector
Defaultnull

displayAllDaySlot

Whether to display the all-day event slot.

Type boolean
Configurability Inspector
Defaultnull

displayEventTime

Whether to display event times.

Type boolean
Configurability Inspector
Defaultnull

displayTimeZone

The time zone (UTC offset) that applies to the display value. Uses the time zone reported by the browser if set to local.

Type string
Configurability Inspector
Defaultnull

displayWeekends

Whether to display weekends.

Type boolean
Configurability Inspector
Defaultnull

endByIndex

A list of end times, by index.

Type array
Array values string
Configurability Read-only
Defaultnull

eventIdByIndex

A list of event IDs, by index.

Type array
Array values string
Configurability Read-only
Defaultnull

eventMaxStack

The maximum number of events to display in a stack.

Type number
Configurability Inspector
Defaultnull

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


firstDayOfWeek

The first day of the week, by index, with Sunday as 0.

Type string
Configurability Inspector
Allowed Values
ValueDescription
0

Sunday.

1

Monday.

2

Tuesday.

3

Wednesday.

4

Thursday.

5

Friday.

6

Saturday.

Defaultnull

groupIdByIndex

A list of group IDs for each item, by index.

Type array
Array values number
Configurability Read-only
Defaultnull

hidden

Whether this object is hidden from view.

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

hoveredEvent

The event on which the cursor hovers.

Type object
Configurability Read-only
Defaultnull

id

The unique identifier (name).

Type string
Format Plain Text
Configurability Inspector
Defaultcalendar1
Examples
query1
button1

initialDate

The initial date to display.

Type string
Configurability Inspector
Defaultnull

isHiddenOnDesktop

Whether to show or hide this object in the desktop layout.

Type boolean
Format True/False
Configurability Inspector > Appearance > Advanced > Show on desktop
Defaultfalse
Examples
true

isHiddenOnMobile

Whether to show or hide this object in the mobile layout.

Type boolean
Format True/False
Configurability Inspector > Appearance > Advanced > Show on mobile
Defaulttrue
Examples
true

itemMode

The configuration mode for options.

Type string
Configurability Inspector > Content > Options
Allowed Values
ValueUI OptionDescription
dynamicMapped

Options dynamically mapped from an array.

staticManual

Options manually configured in the IDE.

Defaultdynamic
Examples
"dynamic"

listType

The date range to display in list view.

Type string
Configurability Read-only
Allowed Values
ValueDescription
day

Day

week

Week

month

Month

year

Year

Defaultnull

maintainSpaceWhenHidden

Whether to take up space on the canvas if hidden is true.

Type boolean
Format True/False
Configurability Inspector > Appearance > Advanced > Maintain space when hidden
Defaultfalse
Examples
true

margin

The amount of margin to render outside.

Type string
Format Plain Text
Configurability Inspector > Spacing > Margin
Allowed Values
ValueUI OptionDescription
4px 8pxNormal

Normal margin.

0None

No margin.

Default4px 8px
Examples
4px 8px

selectedEvent

The selected event.

Type object
Configurability Read-only
Defaultnull

selectedInterval

The selected interval.

Type object
Configurability Read-only
Defaultnull

showInEditor

Whether the component remains visible in the editor if hidden is true.

Type boolean
Format True/False
Configurability Inspector > Appearance > Advanced > Always show in edit mode
Defaultfalse
Examples
true

startByIndex

A list of start times, by index.

Type array
Array values string
Configurability Read-only
Defaultnull

style

Custom style options.

Type object
Configurability Inspector > Appearance > style
Defaultnull

timeFormat

The format of the time.

Type string
Configurability Inspector
Defaultnull

titleByIndex

A list of item titles, by index.

Type array
Array values string
Configurability Read-only
Defaultnull

view

The view.

Type string
Configurability Read-only
Allowed Values
ValueDescription
day

Day

week

Week

month

Month

year

Year

list

List

Defaultnull

viewType

The type of view to display.

Type string
Configurability Inspector
Allowed Values
ValueDescription
day

Day view.

week

Week view.

month

Month view.

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.

calendar.scrollIntoView()

Scrolls the canvas or parent container so that the selected component appears in the visible area.

Definition
calendar.scrollIntoView(options)
Parameters

options

The scroll options.

Type object
Object Properties

behavior

The scroll behavior.

Type string
Allowed Values
ValueDescription
auto

Scroll immediately to the specified position.

smooth

Scroll gradually to the specified position.


block

The scroll position relative to the component.

Type string
Allowed Values
ValueDescription
nearest

Scrolls only the minimum amount required for the component to appear in the visible area. Scrolling does not occur if the component is already in view.

start

Scrolls to position the component at the top of the visible area.

center

Scrolls to position the component in the middle of the visible area.

end

Scrolls to position the component at the bottom of the visible area.



Examples

Scroll the minimum amount to immediately bring calendar into view.

calendar.scrollIntoView({behavior: 'auto', block: 'nearest'});

calendar.setHidden()

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

Definition
calendar.setHidden(hidden)
Parameters

hidden

Whether this object is hidden from view.

Type boolean
Format True/False
Default
false
Examples
true

Examples

Hide calendar.

calendar.setHidden(true);

Unhide calendar.

calendar.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.

EventDescription
Change EventAn event is changed.
Click EventAn event is clicked or pressed.
Create EventAn event is created.
Remove EventAn event is removed.