Changing height of selectInput

654 views
Skip to first unread message

carlos vargas

unread,
Jun 24, 2014, 3:54:00 PM6/24/14
to shiny-...@googlegroups.com
Hello!

Greetings to all of the developers and users. I am designing a browser for a database using shiny. I am a beginner so I apologize beforehand if I ask something too obvious.

One of the options in the browser displays a dynamic selectInput using renderUI. As you can see in the code below, the function renderUI depends on the reactive element currentLinks2 to generate the selectInput which is later built in ui.R using the function uiOutput inside a conditional panel.

The problem i have is that the options in the selectInput can't be displayed because it is inside a fixed div whose height I can't figure out how to modify. I tried using css, but I could not change the height because I can't find the id for the conditionalPanel. 

Also, using the selectize = FALSE option generates a less prettier selection list but i was able to modify the height of this one using:

tags$head(tags$style(type="text/css", "select { min-width: 500px; min-height: 200px; }")). 

Do you have any suggestions?

Thank you in advance,
Carlos

ui.R
conditionalPanel(condition = 'output.foundLinks2 > 1', uiOutput("selectUI2links"))

server.R
output$selectUI2links <- renderUI({
    if(length(currentLinks2()) > 1){
      current <- currentLinks2()
      selectInput("options2links", "Available data:", current, multiple = TRUE)
    } else {
      NULL
    }
  })

pvuto...@gmail.com

unread,
Jun 25, 2014, 6:39:31 AM6/25/14
to shiny-...@googlegroups.com
Wrap all your UI code with a bootstrapPage() call, like so: bootstrapPage(conditionalPanel(condition = 'true', uiOutput("selectUI2links"))).

carlos vargas

unread,
Jun 26, 2014, 9:20:58 PM6/26/14
to shiny-...@googlegroups.com
Thank you for your reply!

I did what you suggested but I still can't change the height. Am I still doing something wrong?

Thanks for your time :)

In ui.R I used: 

bootstrapPage(conditionalPanel(condition = 'true', uiOutput("selectUI")), theme = "styles.css") 

In server.R:

output$selectUI <- renderUI({
    if(length(currentlinks()) > 1){
      current <- currentlinks()
      selectInput("options", "Select your choice:", current, multiple = TRUE) #, selectize = FALSE)
    } 
  })

And in styles.css I only have:

.selectUI2links{
    display:block;
    width:50%;
    height:700px;
    overflow:scroll;
Reply all
Reply to author
Forward
0 new messages