Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

hot_col

Handsontable widget


Description

Configure single column.

Usage

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, ...)

Arguments

hot

rhandsontable object

col

vector of column names or indices

type

character specify the data type. Options include: numeric, date, checkbox, select, dropdown, autocomplete, password, and handsontable (not implemented yet)

format

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.

source

a vector of choices for select, dropdown and autocomplete column types

strict

logical specifying whether values not in the source vector will be accepted

readOnly

logical making the column read-only

validator

character defining a Javascript function to be used to validate user input. See hot_validate_numeric and hot_validate_character for pre-build validators.

allowInvalid

logical specifying whether invalid data will be accepted. Invalid data cells will be color red.

halign

character defining the horizontal alignment. Possible values are htLeft, htCenter, htRight and htJustify

valign

character defining the vertical alignment. Possible values are htTop, htMiddle, htBottom

renderer

character defining a Javascript function to be used to format column cells. Can be used to implement conditional formatting.

copyable

logical defining whether data in a cell can be copied using Ctrl + C

dateFormat

character defining the date format. See Moment.js for details.

default

default column value for new rows (NA if not specified; shiny only)

language

locale passed to Numbro.js; default is 'en-US'.

...

passed to handsontable

See Also

Examples

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)

rhandsontable

Interface to the 'Handsontable.js' Library

v0.3.7
MIT + file LICENSE
Authors
Jonathan Owen [aut, cre, cph], Jeff Allen [ctb], Yihui Xie [ctb], Enzo Martoglio [ctb], Inberg Ger [ctb], Warpechowski Marcin [ctb, cph] (Handsontable.js library), Handsoncode sp. z o.o. [ctb, cph] (Handsontable.js library), Aisch Gregor [ctb, cph] (Chroma.js library), Företagsplatsen [ctb, cph] (Numbro.js library), Draper Adam [ctb, cph] (Numeral.js library), Wood Tim [ctb, cph] (Moment.js library), Chernev Iskren [ctb, cph] (Moment.js library), Moment.js contributors [ctb, cph] (Moment.js library), Bushell David [ctb, cph] (Pikaday.js library), jQuery Foundation [ctb, cph] (jQuery.js library), Splunk Inc [ctb, cph] (Sparkline.js library), Russell Kent [ctb, cph] (Sparkline.js library), Rohan Jon [ctb, cph] (ZeroClipboard library), Greene James [ctb, cph] (ZeroClipboard library)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.