Configure single column.
hot_col(
hot,
col,
type = NULL,
format = NULL,
source = NULL,
strict = NULL,
readOnly = NULL,
validator = NULL,
allowInvalid = NULL,
halign = NULL,
valign = NULL,
renderer = NULL,
copyable = NULL,
dateFormat = NULL,
default = NULL,
language = NULL,
...
)rhandsontable object
vector of column names or indices
character specify the data type. Options include: numeric, date, checkbox, select, dropdown, autocomplete, password, and handsontable (not implemented yet)
characer specifying column format. See Cell Types at Handsontable.js for the formatting options for each data type. Numeric columns are formatted using Numbro.js.
a vector of choices for select, dropdown and autocomplete column types
logical specifying whether values not in the source
vector will be accepted
logical making the column read-only
character defining a Javascript function to be used
to validate user input. See hot_validate_numeric and
hot_validate_character for pre-build validators.
logical specifying whether invalid data will be accepted. Invalid data cells will be color red.
character defining the horizontal alignment. Possible values are htLeft, htCenter, htRight and htJustify
character defining the vertical alignment. Possible values are htTop, htMiddle, htBottom
character defining a Javascript function to be used to format column cells. Can be used to implement conditional formatting.
logical defining whether data in a cell can be copied using Ctrl + C
character defining the date format. See Moment.js for details.
default column value for new rows (NA if not specified; shiny only)
locale passed to Numbro.js; default is 'en-US'.
passed to handsontable
library(rhandsontable)
DF = data.frame(val = 1:10, bool = TRUE, big = LETTERS[1:10],
small = letters[1:10],
dt = seq(from = Sys.Date(), by = "days", length.out = 10),
stringsAsFactors = FALSE)
rhandsontable(DF, rowHeaders = NULL) %>%
hot_col(col = "big", type = "dropdown", source = LETTERS) %>%
hot_col(col = "small", type = "autocomplete", source = letters,
strict = FALSE)
#> Warning: as.character(td, ..) no longer obeys a 'format' argument; use format(td, ..) ?