Using renderDataTable within renderUi in Shiny

前端 未结 1 616
夕颜
夕颜 2021-02-05 08:31

I\'m experimenting a Shiny App to show dynamic contexts, but I cannot get renderDataTable working into a renderUi component. Below two simple replicabl

相关标签:
1条回答
  • 2021-02-05 09:23

    It would be clearer if you split the part of datatable generation and ui generation :

    library(shiny)
    runApp(list(
        ui = fluidPage(
                mainPanel(
                        uiOutput('myTable')
                )
        ),
        server = function(input, output) {
                output$aa <- renderDataTable({iris})
                output$myTable <- renderUI({
                        dataTableOutput("aa")
                })
        }
    ))
    
    0 讨论(0)
提交回复
热议问题