如何更正 - selectizeInput显示在absolutePanel上方

时间:2015-07-30 09:24:16

标签: r shiny rstudio

下面是我用于显示selectizeInputabsolutePanel的代码。 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 :(得分:1)

问题是,选择的z-index CSS属性为1,因此它显示在您的absolutePanel上方。

尝试将此添加为fluidPage的第一个元素,将z-index更改为0:

tags$style(type="text/css", ".selectize-input{ z-index: 0; }")

enter image description here