我需要我的 Shiny 模块来隐藏/显示命名空间之外的 div。我尝试将 div id 传递给模块服务器函数并使用shinyjs 来显示/隐藏它,但这不起作用。我没有收到错误,它只是不显示/隐藏 div。
我知道闪亮的模块文档说模块无法访问命名空间之外的输出。不过,文档确实为模块提供了一种使用反应式访问命名空间之外的输入的方法。
有谁知道是否有办法让 Shiny 模块访问命名空间之外的输出?
这是我想做的:
### ui.R ###
header <- dashboardHeader(
title = a(href = 'http://google.com')
)
dashboardPage(
skin = 'black',
header,
dashboardSidebar(
sidebarMenu( id='tabs',
menuItem('Edit Existing Client', tabName = 'client-info')
)),
dashboardBody(
useShinyjs(),
fluidRow(
tabItems(
tabItem(tabName = "client-info",
div(selectClientModuleUI("clientinfons")),
div(id='editclientinfo', uiOutput('editclientstuff'))
)
)
)
)
)
### server.R ###
shinyServer(function(session,input, output) {
output$editclientstuff <- renderUI({
div(
fluidRow(
column(6,
textInput('editname', "Display name", value ='Testing name')
),
column(6,
numericInput('editastart','Start', value ='3')
) …Run Code Online (Sandbox Code Playgroud)