Skip to contents

Set editor

Usage

set_editor(
  widget,
  columns,
  editor = c("input", "textarea", "number", "range", "tickCross", "star", "progress",
    "date", "time", "datetime", "list"),
  validator = NULL,
  ...
)

Arguments

widget

A tabulator() HTML widget.

columns

The names of the columns the formatter is applied to.

editor

(character): The editor type.

validator

(character vector): One or more validators to validate user input.

...

Optional editor parameters depending on the selected editor.

Value

The updated tabulator() HTML widget

See also

Examples

setup <- tabulator_options(edit_trigger_event = "click")

tabulator(iris[, c(2, 5)], setup) |>
  set_editor(
    column = "Species",
    editor = "list",
    values_lookup = "active",
    clearable = TRUE,
    autocomplete = TRUE
  ) |>
  set_editor(
    column = "Sepal_Width",
    editor = "number",
    min = 0,
    max = 10,
    step = 0.1,
    validator = c("min:0", "max:10")
  )