Closed ivokwee closed 3 years ago
I also tried using dashboardHeaderPlus() but also doesn't work.
Thanks for the report
any movement on this?
I ran in the same problem today and found this solution:
As mentioned in the blog post, it works by creating a new input value for clicking the sidebar-toggle button with
tags$script("$(document).on('click', '.sidebar-toggle', function () {
Shiny.onInputChange('SideBar_col_react', Math.random())});"),
then create TRUE and FALSE values with
vals<-reactiveValues()
vals$collapsed=FALSE
observeEvent(input$SideBar_col_react,{
vals$collapsed=!vals$collapsed
})
and finally creating a new reactive expression with the new vals$collapsed parameter that reacts on clicking the toggle button.
size <- reactive({
if(vals$collapsed){
return("50px")
} else {
return("120px")
}
})
Anyway it would be nice to have the input$sidebarCollapsed parameter in future releases of shinydashboardPlus, but for the moment it works as a nice workaround for me.
Hi,
I think the
input$sidebarCollapsed
does not work for shinydashboardPlus. It works for dashboardPage but as soon as I use dashboardPagePlus it does not work.The code below does not work properly.
Ivo