我正在编程一个更大的闪亮界面,ui.r mainPanel包含一个带有多个tabPanel的tabsetPanel,并且位于每种不同类型的表格和绘图输出中。除了需要滚动的页面倾向于在他们的滚动位置上跳转时,例如(重新)选择绘图输出,表格条目等,跳转有时看起来很棒。有时跳转到页面的开始处,有时跳到其他地方;它们都出现在Firefox和Chrome中。因此,有没有办法来防止或抑制这种跳跃?非常感谢您的帮助。滚动后闪亮的页面跳转
下面是一个小例子,其中用户界面跳转到页面顶部的选择表中的行页面的底部形成之后:
library(shiny)
library(DT)
data=data.frame(x=1:10,y=2:11)
ui=shinyUI(
fluidPage(
plotOutput("plot1"),
plotOutput("plot2"),
DT::dataTableOutput("tt")
)
)
server=shinyServer(function(input, output) {
dd=reactiveValues(d=data)
output$plot1 <- renderPlot({plot(0,1)})
output$plot2 <- renderPlot({plot(0,1)})
output$tt=DT::renderDataTable(
datatable(
dd$d,selection =c('single')
)
)
observeEvent(input$tt_rows_selected,{
dd$d[input$tt_rows_selected,1]<-log(dd$d[input$tt_rows_selected,1])
})
})
shinyApp(ui,server)
您能否包含一些示例代码?我不是很了解你的问题,并提供一个[可重现的例子](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example)将是非常有益的。 –
当然,在上面补充说。 – martin