selectizeInput显示在absolutePanel上方 - 如何避免

时间:2015-07-29 12:36:47

标签: r rstudio

下面给出了我用于显示selectizeInput和absolutePanel的代码。 selectizeInput未与页面背景合并。它显示在absolutePanel上方。请帮我解决。

ui.r

library(shinydashboard)
      shinyUI(
        fluidPage(
          dashboardPage(skin = c("blue"),
                        dashboardHeader(title = "R Tools"
                        ),
                        ## Sidebar content
                        dashboardSidebar(
                          sidebarMenu(
                            menuItem("Dashboard", tabName = "dashboard", icon = icon("dashboard")),
                            menuItem("Widgets", tabName = "widgets", icon = icon("th"))
                          )

                        ),
                        dashboardBody(
                                          box(
                                            title = "Tools", status = "primary", solidHeader = TRUE,
                                            collapsible = TRUE,width = 4,
                                            uiOutput("showtxttruevalue"),
                                            uiOutput("showddllalternate")
                                          ),
                                          absolutePanel(
                                            bottom = 20, right = 60,top=200, width = "auto",
                                            draggable = TRUE,
                                            wellPanel(
                                            "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                                            aa")
                                            ), style = "opacity: 0.9"



                        )

          )


        ))

server.r

library(shiny)
library(ggplot2)
library(googleVis)

shinyServer(function(input, output, session) {




output$showtxttruevalue <- renderUI({
    numericInput(inputId="txttruevalue", label="TrueValue", value = 0)
 })


output$showddllalternate <- renderUI({
    selectizeInput("ddllalternate", "Alternate:",c('unequal','less','greater'),   selected='<>')
  })



  })

1 个答案:

答案 0 :(得分:0)

要解决此问题,请在定位'left'时使用absolutePanel()参数。使用以下方法进行定位。

absolutePanel(
                      left = 500, bottom = 20, right = 60,top=200, width = "auto",
                      draggable = TRUE,
                      wellPanel(
                        "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
                                            aa")
                    ), style = "opacity: 0.9"