R: Handsontable widget

hot_col {rhandsontable} | R Documentation

## 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

`hot_cols`, `hot_rows`, `hot_cell`

### 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)

[Package rhandsontable version 0.3.6 Index]