set_editor: Set editor

View source: R/columns.R

set_editorR Documentation

Set editor

Description

Set editor

Usage

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

Arguments

widget

A tabulator() HTML widget.

column

The name of the column 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")
  )

rtabulator documentation built on Sept. 23, 2024, 5:11 p.m.