grid_col_checkbox {toastui} | R Documentation |
Display checkboxes in grid's column
Description
Display checkboxes in grid's column
Usage
grid_col_checkbox(
grid,
column,
class = "form-check d-flex justify-content-center my-1",
...
)
Arguments
grid |
A table created with |
column |
The name of the column where to create buttons. |
class |
CSS classes to add to checkbox container. |
... |
Further arguments passed to |
Value
A datagrid
htmlwidget.
Examples
library(toastui)
library(shiny)
library(bslib)
ui <- fluidPage(
theme = bslib::bs_theme(version = 5L),
tags$h2("Checkbox column grid demo"),
fluidRow(
column(
width = 8,
datagridOutput("grid"),
verbatimTextOutput("edited")
)
)
)
server <- function(input, output, session) {
output$grid <- renderDatagrid({
data.frame(
month = month.name,
checkboxes = sample(c(TRUE, FALSE), 12, replace = TRUE),
switches = sample(c(TRUE, FALSE), 12, replace = TRUE)
) %>%
datagrid(data_as_input = TRUE) %>%
grid_col_checkbox(column = "checkboxes") %>%
grid_col_checkbox(
column = "switches",
# /!\ will only works with bslib::bs_theme(version = 5L)
class = "form-check form-switch d-flex justify-content-center my-1"
)
})
output$edited <- renderPrint({
input$grid_data # outputId + "_data
})
}
if (interactive())
shinyApp(ui, server)
[Package toastui version 0.3.3 Index]