在闪亮的app中,数字输入小部件是在行和列中动态创建的,如果选择了2列以上,我想将其放入带水平滚动条的框中。
滚动条在顶部和底部都出现但处于非活动状态。我已尝试使用滚动中的自动选项但不能正常工作。请帮忙。
ui.R
library(shiny)
library(shinydashboard)
ui <- shinyUI(fluidPage(
titlePanel(title = "scroll bar in inactive state"),
sidebarLayout(
sidebarPanel(numericInput("rows","Input No. of rows",value = 5,min=1),
br(),
numericInput("col","Input No. of cols",value = 1,min=1)),
mainPanel(box(title = "what if",
width = 7,
style = "overflow-x: scroll", uiOutput("plo")))
)))
server.R
server <- function(input,output){
# creating input widgets dynamically
output$plo <- renderUI({
z <- input$col
lapply(seq(input$col), function(j){
column(width=5,
lapply(seq(input$rows),function(i){
numericInput(inputId = paste0("range",paste0(i,j)),label =
j,value = paste0(i,j))
})
)
})
})
}
答案 0 :(得分:0)
请尝试使用
div(style = 'overflow-x: scroll', uiOutput("plo"))
而不是
style =“ overflow-x:scroll”,uiOutput(“ plo”)