我已经对这个问题进行了很多研究,但到目前为止,当使用 Shiny 的 showModal() 而不是 bsModal() 时,还没有提供解决方案。
当我第二次在模态对话框中显示rhandsontable时,显示有问题,即并非所有列都显示。
下面是一个例子:
library(shiny)
library(rhandsontable)
u <- shinyUI(fluidPage(
# Will show first pop-up
actionButton("go", "Show Table")
))
s <- shinyServer(function(input,output,session){
df <- data.frame(Wnr = 1:10)
observeEvent(input$go, {
output$table <- renderRHandsontable({
rhandsontable(df, width = "100%", height = 200)
})
showModal(modalDialog(
title = "Table",
rHandsontableOutput("table"),
footer = tagList(actionButton("go2", "Continue"),
modalButton("Stop"))
))
})
observeEvent(input$go2, {
removeModal()
# Recalculate the table, adding new columns
output$table <- renderRHandsontable({
df$AC <- 1
df$BC <- …Run Code Online (Sandbox Code Playgroud)