小编Tob*_*bel的帖子

闪亮的 RHandsontable 在闪亮的 modalDialog 中没有正确显示

我已经对这个问题进行了很多研究,但到目前为止,当使用 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)

javascript modal-dialog shiny shinybs rhandsontable

5
推荐指数
0
解决办法
378
查看次数

标签 统计

javascript ×1

modal-dialog ×1

rhandsontable ×1

shiny ×1

shinybs ×1