I am trying to remove the entire wellpanel using removeUI() in my shiny app. I'm not sure what to be used as a selector. Can anyone help me in this regard?
            Asked
            
        
        
            Active
            
        
            Viewed 120 times
        
    1 Answers
2
            If you create the UI and then open up a Shiny app in a browser and use inspect element you can see that wellPanel has a class = well
So one possibility is to specify the class a selector like .class_name. In your case it is: selector = ".well".
Here is a minimal Shiny app that removes a single wellPanel from a page using class
library(shiny)
ui <- fluidPage(
  wellPanel(
    "This is going to be removed",
    plotOutput("plot")
  ),
  actionButton("btn", "Remove wellPanel")
)
server <- function(input, output, session) {
  output$plot <- renderPlot(plot(iris))
  observeEvent(input$btn, {
    removeUI(selector = ".well")
  })
}
shinyApp(ui, server)
 
    
    
        GyD
        
- 3,902
- 2
- 18
- 28
 
    