Home:ALL Converter>Disable walking between tabs Shiny

Disable walking between tabs Shiny

Ask Time:2018-03-16T14:42:27         Author:neringab

Json Formatter

I have shiny application with several tabs. The problem is that I want to walk between tabs with button, not by clicking on the tab. How I can disable clicking on tabs? Small example of code:

ui <- navbarPage('Test App', id = "inTabset",
                 tabPanel(title = "Panel 1", value = "panel1", 
                          actionButton('jumpToP2', 'Jump to Secon Tab')),
                 tabPanel(title = "Panel 2", value = "panel2", 
                          actionButton('jumpToP1', 'Jump to First Tab'))
)

server <- function(input, output, session) {
  observeEvent(input$jumpToP2, {
    updateTabsetPanel(session, "inTabset",
                      selected = "panel2")
  })

  observeEvent(input$jumpToP1, {
    updateTabsetPanel(session, "inTabset",
                      selected = "panel1")
  })

}

shinyApp(ui, server)

Author:neringab,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/49314658/disable-walking-between-tabs-shiny
yy