r - 使用 Shiny App 中的按钮删除活动标签面板
问题描述
大家好,我很想知道是否可以在闪亮的应用程序上删除当前活动的 tabPanel:
这是我的代码:
# server
observeEvent(input$removeTab, priority = 20, {
removeTab(inputId="sortTab", target=input$ACTIVE_TAB)
})
# ui
actionButton("removeTab", "Remove current tab")
非常感谢你的帮助!
解决方案
Here is the answer. If the tabPanel that we desire to remove is encapsulated in a TabsetPanel, for example in a :
TabsetPanel(id='sortTab',
Tabpanel(),
Tabpanel()
)
We juste have to respecify the TabSetPanel id with the input
argument on the target :
# server
observeEvent(input$removeTab, priority = 20, {
removeTab(inputId="sortTab", target=input$sortTab)
})
# ui
actionButton("removeTab", "Remove current tab")
推荐阅读
- google-cloud-platform - AWS 使用私钥承担 iam 角色与 gcp 的 json 文件
- entity-framework - Linq To Entities - 在 DB 上运行 CONVERT to int
- macos - NSTableView 内的 NSTableViewCell
- apache-spark - 在使用带有 kafka 的火花流时,无法迭代从将 Dstream 转换为 List 中检索到的键列表
- angular - 角度形式:无法读取未定义的属性“cafPlanForm”
- java - 在java中模拟ExecutorService的invokeAll方法
- android - 是否可以使用简单的浏览器从我的网站安装 Android 应用程序?
- python-3.x - 不能 Glob 几种文件类型
- flask - 烧瓶:应用程序工厂中的代码未执行
- openlayers - 链接到旧的 openlayers api