-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update selection in server.R (shiny) #8
Comments
If you re-install from GitHub you will have a To clear the selection use Here's an example : # updateTreeview ----------------------------------------------------------
library(shiny)
library(shinytreeview)
data("cities")
ui <- fluidPage(
tags$h3("Update label & selected value"),
treeviewInput(
inputId = "tree",
label = "Choose a city:",
choices = make_tree(cities, c("continent", "country", "city")),
multiple = FALSE,
prevent_unselect = TRUE
),
verbatimTextOutput(outputId = "result"),
textInput("label", "New label:", "Choose a city:"),
radioButtons(
"selected", "Selected:",
choices = unique(c(cities$continent, cities$country, cities$city)),
inline = TRUE
)
)
server <- function(input, output, session) {
output$result <- renderPrint({
input$tree
})
observe(updateTreeview(inputId = "tree", label = input$label))
observe(updateTreeview(inputId = "tree", selected = input$selected))
}
if (interactive())
shinyApp(ui, server) |
Thank you very much, it works well! I'll take advantage one last time of your availability and responsiveness and post another issue on a different topic. |
Thanks for sharing package. Looks great. Is it likely that you will add a "choices" argument to UpdateTreeview (as in the UpdateSelectInput)? |
Hi,
Is there a way to change the value of the tree input on the client? Something like what
updateCheckboxGroupInput
does forcheckboxGroupInput
. What I would like to include in my app is a "Reset selection" button, which reverts the selection of the nodes in the tree to the default one.The text was updated successfully, but these errors were encountered: