刷新闪亮输出并将焦点设置到页面的所需部分

发布于 2025-01-20 21:43:34 字数 1162 浏览 1 评论 0原文

我尝试实施这里提出的解决方案: 不遵循 URL 路径协议

将我的所有绘图分隔在不同的文件中。

所以基本上我有单选按钮,并根据用户选择加载不同的 html 文件:

 else if (input$chap == "4" & input$cat == "2") {
    output$uiStub <- renderUI(tagList(             # a single-output stub ui basically lets you
      fluidPage(                                  #     move the ui into the server function
        fluidRow(
          column(12,
                 includeHTML("./html/mediapar.html")
          )
        ),
        uiOutput("pageStub")                     # loaded server code should render the
      )                                           #    rest of the page to this output$
    ))
  }

我的问题是,每次刷新不同的文件(仅页面的一部分)时,页面的焦点都会丢失,用户必须再次向下滚动并再次到达页面末尾,可以再次进行选择并显示绘图。

fluidRow( style = "background-color:#FFFAFA00;",
            
            box(
              width = 12,
              solidHeader = TRUE,
              header = TRUE,
              background = NULL,
              ui <- uiOutput("uiStub") 
            )

对于这种情况有什么解决方法吗?

亲切的问候

I have tried to implement the solution proposed here:
Not following URL Path Protocol

to separate all my plots in different files.

So basically I have radio buttons and based on user choice a different html file is loaded:

 else if (input$chap == "4" & input$cat == "2") {
    output$uiStub <- renderUI(tagList(             # a single-output stub ui basically lets you
      fluidPage(                                  #     move the ui into the server function
        fluidRow(
          column(12,
                 includeHTML("./html/mediapar.html")
          )
        ),
        uiOutput("pageStub")                     # loaded server code should render the
      )                                           #    rest of the page to this output$
    ))
  }

My problem is that every time a different file refresh (only one part of the page) the focus of page is lost and user has to scroll down again and again to get to the end of page where the choice can be made again and the plot shown.

fluidRow( style = "background-color:#FFFAFA00;",
            
            box(
              width = 12,
              solidHeader = TRUE,
              header = TRUE,
              background = NULL,
              ui <- uiOutput("uiStub") 
            )

Is there any workaround for this situation?

Kind Regards

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文