shiny dashboard: jump to specific element in app by clicking infoBox
<p>In my shiny app I want to add an option to let users jump to a specific element in the app (a table, a plot, just anything with an id), on current or different <code>tab</code>, by clicking on <code>infoBox</code> (or any other object I want). </p>

<p>My solution was to surround <code>infoBox</code> with <code>div</code> and add the<code>href=#id_of_element</code> attribute. Unfortunately this solution works only for <code>tabs</code> with an extra <code>"data-toggle" = "tab"</code> attribute (it also does not change the opened <code>tab</code> to <code>active</code>), but that's not what I want.</p>

<p>My question is: how can I add the mentioned option and why this solution isn't working? Here is a small example what I want to do:</p>

<p>UI</p>

<pre><code>library(shiny)
library(shinydashboard)

shinyUI(
  dashboardPage(
    skin = "blue",
     dashboardHeader(title = "Example"),
    dashboardSidebar(
      sidebarMenu(id = "sidebarmenu",
              menuItem("Tab1", icon = icon("line-chart"),
                       menuSubItem("SubTab1", tabName = "sub1", icon = icon("bar-chart")),
                          menuSubItem("SubTab2", tabName = "sub2", icon = icon("database"))),
              menuItem("Tab2", tabName = "tab2", icon = icon("users"))
      )
    ),
    dashboardBody(
      tabItems(
       tabItem(tabName = "sub1",
          tags$div(href="#s2t2",
                   infoBox(value = "Go to table 2 in SubTab2 (not working)",title = "Click me")),
          tags$div(href="#shiny-tab-tab2", "data-toggle" = "tab",
                   infoBox(value = "Go to Tab2 (this works)",title = "Click me"))
        ),
        tabItem(tabName = "sub2",
               tableOutput("s2t1"),
               tableOutput("s2t2")
                ),
        tabItem(tabName = "tab2",
                tableOutput("t2t1"),
                tableOutput("t2t2")
        )
      )
    )
  )
)
</code></pre>

<p>SERVER:</p>

<pre><code> shinyServer(function(input, output,session) {
  output$s2t1&lt;- renderTable(mtcars)
  output$s2t2&lt;- renderTable(mtcars)
  output$t2t1&lt;- renderTable(mtcars)
  output$t2t2&lt;- renderTable(mtcars)
} )
</code></pre>