本文介绍了水平滚动条在非活动状态下发亮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在闪亮的应用程序中,如果要选择多于2列,我会在行和列中动态创建数字输入小部件,我希望将它们放置在带有水平滚动条的框中.
In shiny app numeric input widgets are created dynamically in row and column which i want to put in a box with horizontal scroll bar if more than 2 columns are selected.
滚动条同时出现在顶部和底部,但处于非活动状态.我曾尝试在滚动中使用自动选项,但无法正常工作.请帮忙.
Scroll bars appeared both at top and bottom but in inactive state.I have tried with auto option in scroll but not working. Please help.
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))
})
)
})
})
}
推荐答案
请尝试使用
div(style = 'overflow-x: scroll', uiOutput("plo"))
而不是style ="overflow-x:scroll",uiOutput("plo")
div(style = 'overflow-x: scroll', uiOutput("plo"))
instead of style = "overflow-x: scroll", uiOutput("plo")
这篇关于水平滚动条在非活动状态下发亮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!