Description Usage Arguments Value Examples
View source: R/checkboxTreeInput.R
Convert a tree data.frame into a ul list
1 2 | checkboxTreeInput(inputId, label = NULL, tree, selected = NULL,
opened = NULL)
|
inputId |
The |
label |
Display label for the control, or |
tree |
a |
selected |
The nodes that should be initially selected, if any. All selected nodes (and their ancestors) will also be opened, to be visible. |
opened |
The nodes that should be initially opened, if any. All ancestor nodes will also be opened. |
A list of HTML elements that can be added to a UI definition.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | tree <- data.frame(id=1:3, parent_id=c(NA, 1, 2))
checkboxTreeInput("foo", tree=tree)
checkboxTreeInput("foo", tree=tree, selected=3)
if (interactive()) {
tree <- data.frame(id=1:6, parent_id=c(NA, 1, 2, 2, NA, 1))
ui <- fluidPage(
checkboxTreeInput(inputId="tree", label="Tree selector",
tree=tree, selected=c(1, 6), opened=1
),
verbatimTextOutput("selected")
)
server <- function(input, output, session) {
output$selected <- renderPrint( input$tree )
}
shinyApp(ui, server)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.