背景:在我的应用程序中,我构建了一个弹出模式,其中用户可以定义变量/参数,然后在按下时将它们存储在 areactiveValues()中actionButton。这看起来效果很好。
问题:我有一个单独的actionButton,应该清除/清空保存reactiveValues上面输入的内容。不幸的是,这似乎不起作用——也就是说,按下按钮没有任何作用。
最小可重复代码:
library(DT)
# UI modules
sidebarCharts <- function(id) {
ns <- NS(id)
tagList(
p(),
actionButton(ns("settings"), "Settings",
icon = icon("cogs"),
width = '100%',
class = "btn btn-info"),
p(),
actionButton(ns("refreshMainChart") ,"Refresh",
icon("refresh"),
width = '100%',
class = "btn btn-primary"),
p(),
textOutput(ns("info")) # FOR DEBUGGING
)
}
mainChartUI <- function(id) {
ns <- NS(id)
plotOutput(ns("mainChart"), width = "100%")
}
# UI module for the 2 buttons in the modal:
modalFooterUI …Run Code Online (Sandbox Code Playgroud)