【问题标题】:How to place the drop-down list and textInput horizontally如何水平放置下拉列表和textInput
【发布时间】:2017-11-27 08:20:24
【问题描述】:

我目前正在开发一个闪亮的应用程序。我在水平放置元素时遇到了问题。

使用的RCode如下:

ui <- fluidPage( 
  fluidRow(
  column(3, 
         selectizeInput("proj1", NULL,
                        choices = Dummy$Project_1, width = "300px",
                        options = list(
                          placeholder = "Additional Projects",
                          onInitialize = I('function() { this.setValue(""); }')
                        )
         )),
  column(3, textAreaInput("col11","", width = "200px", height = "43px")),
  column(3, textAreaInput("col12","", width = "200px", height = "43px")),
  column(3, textAreaInput("col13","", width = "200px", height = "43px"))
)
)
server <- function(input, output){}

shinyApp(ui = ui, server = server)

输出如下:

谁能帮我解决这个问题?

【问题讨论】:

    标签: r shiny


    【解决方案1】:

    在您的选择输入而不是 NULL 中,如果您提供一些标题,那么它将正常工作。下面是代码:

    ui <- fluidPage( 
      fluidRow(
        column(3, 
               selectizeInput("proj1", "Choose value",
                              choices = c("A","B"), width = "300px",
                              options = list(
                                placeholder = "Additional Projects",
                                onInitialize = I('function() { this.setValue(""); }')
                              )
               )),
        column(3, textAreaInput("col11","", width = "200px", height = "43px")),
        column(3, textAreaInput("col12","", width = "200px", height = "43px")),
        column(3, textAreaInput("col13","", width = "200px", height = "43px"))
      )
    )
    server <- function(input, output){}
    
    shinyApp(ui = ui, server = server)
    

    【讨论】:

    • 或者只是添加""而不是"Choose value"
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-06-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-01-29
    相关资源
    最近更新 更多