可以相对轻松地在平面 Shiny 应用程序中使用锚链接 - /sf/answers/2002386221/。
然而,有可能是一个外部链接针对特定tabPanel的navbarPage一个闪亮的应用程序?
考虑以下测试应用程序: UI:
shinyUI(navbarPage(
"Anchor Test",
tabPanel(
"Panel 1", fluidPage(HTML(
paste(
"<p>I'm the first panel</p>","<p><a href='#irisPlotUI'>Link to irisPlotUI in panel 2</a></p>",
"<a href='#panel2'>Link to panel 2</a>",sep = ""
)
))
),
tabPanel("Panel 2", fluidPage(
"I'm the second panel", uiOutput("irisPlotUI")
),
value = "#panel2"),
tabPanel("Panel 3", "I'm a table!!!")
Run Code Online (Sandbox Code Playgroud)
服务器:
shinyServer(function(input, output) {
output$irisPlotUI <- renderUI(plotOutput("irisPlot"))
output$irisPlot <- renderPlot(plot(iris$Sepal.Length))
})
Run Code Online (Sandbox Code Playgroud)
使用链接答案中的方法不起作用, idirisPlotUI是正确的,但tabPanel它是情节所在的 id 的子代。
该data-value的 …
(来自闪亮的谷歌群组的交叉帖子,https://groups.google.com/forum/#!topic / shiny-discuss/CvoABQQoZeE)
如何导航到ShinyDashboard中的特定侧边栏菜单项?
sidebarMenu(
menuItem("Menu Item 1")
menuItem("Menu Item 2")
)
Run Code Online (Sandbox Code Playgroud)
即如何在"菜单项1"页面上放置一个链接到"菜单项2"的按钮?
要在标签之间导航,我使用updateTabsetPanel函数:
observeEvent(input$go,{
updateTabsetPanel(session, "tabset1", selected = "Step 2")
})
Run Code Online (Sandbox Code Playgroud)
我相信我应该能够使用类似的功能导航到侧边栏菜单,但我不确定那是什么.
任何指针都非常感激
谢谢
伊恩