Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(shiny)
- library(shinydashboard)
- library(shinyjs)
- tabItem_welcome <-
- tabItem(tabName = "welcome",
- textInput("welcome_text", label=NULL, value = "")
- )
- tabItem_a <-
- tabItem(tabName = "a", id = "a",
- h2("A")
- )
- dashboardPage(
- dashboardHeader(title = "test"),
- dashboardSidebar(
- sidebarMenu(id = "tab",
- menuItem("Welcome", tabName = "welcome"),
- menuItem("A", tabName = "a")
- )
- ),
- dashboardBody(
- useShinyjs(),
- tabItems(
- tabItem_welcome,
- tabItem_a
- )
- )
- )
- shinyServer(function(input, output) {
- hide(id = "a")
- observe({
- welcome_text <- input$welcome_text
- if(welcome_text=="show a"){
- show(id = "a")
- }
- })
- })
Add Comment
Please, Sign In to add comment