API reference

Built-in edit controls

You can use these controls by returning their name from an edit_control hook, or reference them for inspiration when authoring your own controls.

CheckboxControl

Renders a checkbox. Persists a 1 when checked, 0 otherwise.

See CheckboxControl on GitHub.

DateControl

Renders a timezone-aware date picker, with optional time picker.

Persists an ISO 8601 date or timestamp string.

Options:

  • t - if true, uses a T as the time separator; otherwise uses a space
  • utc - if true, saves time in UTC timezone with a Z suffix; otherwise saves in user's local time with no zone suffix
  • precision - one of date, secs or millis; controls whether a date or time is persisted, and with what granularity

See DateControl on GitHub.

Renders a dropdown. Persists the value field.

Options:

  • choices - an array of { value: "value to store"; label: "Label to show" } objects

See DropdownControl on GitHub.

ForeignKeyControl

Renders an autocomplete box to pick a row from another table.

Options:

  • initialLabel - the initial label to show
  • otherAutosuggestColumnUrl - the URL of the autosuggest endpoint
  • labelColumn - the column to autosuggest

See ForeignKeyControl on GitHub.

JSONTagsControl

Renders a multiselect control to popular a JSON array of strings.

Options:

See JSONTagsControl on GitHub.

NumberControl

Renders a text input that saves its value as a number.

See NumberControl on GitHub.

StringAutocompleteControl

Renders a free-form text input that also autocompletes against values from a column.

Options:

See StringAutocompleteControl on GitHub.

StringControl

Renders a free-form single-line text input.

See StringControl on GitHub.

TextareaControl

Renders a free-form multi-line text input.

See TextareaControl on GitHub.

Previous
Custom edit controls