CopyPastor

Detecting plagiarism made easy.

Score: 0.8088512420654297; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2021-02-18
by YBS

Original Post

Original - Posted on 2018-03-27
by Harrison



            
Present in both answers; Present only in the new answer; Present only in the old answer;

You have to call `useShinyjs()` in the `ui` as shown below.

library(shiny) library(shinyjs) ui <- fluidPage( useShinyjs(), navbarPage(title = "Test", tabPanel("Home", sidebarPanel( actionButton("append", "Analyse") ), mainPanel() ) ) ) server <- function(input, output, session) { observeEvent(input$append,{ disbut<-1 if(disbut==1) { shinyjs::disable("append") } else { shinyjs::enable("append") } }) } shinyApp(ui, server)

An example of the toggle option suggested in previous comments.
library(shiny) library(shinyjs) ui <- fluidPage( useShinyjs(), navbarPage("", tabPanel("tab", div( id ="Sidebar",sidebarPanel( )), mainPanel(actionButton("toggleSidebar", "Toggle sidebar") ) ) ) ) server <-function(input, output, session) { observeEvent(input$toggleSidebar, { shinyjs::toggle(id = "Sidebar") }) } shinyApp(ui, server)

        
Present in both answers; Present only in the new answer; Present only in the old answer;