View source: R/cheetah_utils.R
column_def | R Documentation |
Needed by cheetah to customize columns individually.
column_def(
name = NULL,
width = NULL,
min_width = NULL,
max_width = NULL,
column_type = NULL,
action = NULL,
menu_options = NULL,
style = NULL,
message = NULL,
sort = FALSE
)
name |
Custom name. |
width |
Column width. |
min_width |
Column minimal width. |
max_width |
Column max width. |
column_type |
Column type. By default, the column type is inferred from the data type of the column. There are 7 possible options:
|
action |
The action property defines column actions. Select the appropriate Action class for the column type.
|
menu_options |
A list of menu options when using |
style |
Column style. |
message |
Cell message. Expect a |
sort |
Whether to sort the column. Default to FALSE. May also be a JS callback to create custom logic (does not work yet). |
When you write a message, you can pass a function like so:
<COLNAME> = column_def( action = "input", message = JS( "function(rec) { return { //info message type: 'info', message: rec.<COLNAME> ? null : 'Please check.', } }") )
Or use add_cell_message()
:
<COLNAME> = column_def( action = "input", message = add_cell_message(type = "info", message = "Ok") )
See add_cell_message()
for more details.
A list of column options to pass to the JavaScript API.
cheetah(
iris,
columns = list(
Sepal.Length = column_def(name = "Length"),
Sepal.Width = column_def(name = "Width"),
Petal.Length = column_def(name = "Length"),
Petal.Width = column_def(name = "Width")
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.