Skip to content
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

conditionalPanel method doesn't work with dynamically rendered sidebarMenu #86

Closed
yipcma opened this issue Aug 19, 2015 · 2 comments
Closed

Comments

@yipcma
Copy link

yipcma commented Aug 19, 2015

Applying the method mentioned in #28 the conditionalPanel method doesn't seem to work when the sidebarMenu is rendered dynamically. Thoughts? More specifically, I'm trying to do access control using renderMenu:
Question 1: would there be a way to make conditionalPanel work with a dynamically rendered sidebarMenu?
Question 2: is there a better way to do access control? I'm using a method akin to http://withr.me/authentication-of-shiny-server-application-using-a-simple-method/
Thank you in advance.

@Pauline6010
Copy link

Having the same issue. Did you find any solution ?

@wch wch added the backlog label Jan 26, 2017
@bborgesr
Copy link
Contributor

It's highly likely that there was a change that corrected this behavior over the last year (since it's been a while, sorry!), and this does seem to be working now (code adapted from #28, works equally well with a dynamic sidebar menu):

library(shiny)
library(shinydashboard)

ui <- dashboardPage(
  dashboardHeader(),
  dashboardSidebar(
    sidebarMenuOutput("menu"),
    sliderInput("x", "Outside of menu", 1, 100, 50)
  ),
  dashboardBody()
)

server <- function(input, output, session) {
  
  output$menu <- renderMenu({
    sidebarMenu(id = "tabs",
      menuItem("A", tabName = "a",  icon = icon("group", lib="font-awesome")),
      menuItem("B", tabName = "b", icon = icon("check-circle", lib = "font-awesome")),
      conditionalPanel("input.tabs === 'b'",
        sliderInput("b", "Under sidebarMenu", 1, 100, 50)
      )
    )
  })
}

shinyApp(ui, server)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants