Great R community, I am just wondering if it is possible to show DT::dataTableOutput in a modal with the push of an action button. For example, data table output as something like following.
Here is a some code to begin with:
## app.R ##
library(shiny)
library(shinydashboard)
ui <- dashboardPage(
dashboardHeader(),
## Sidebar content
dashboardSidebar(
sidebarMenu(
menuItem("Dashboard", tabName = "dashboard", icon = icon("dashboard"))
)
),
## Body content
dashboardBody(
tabItems(
# First tab content
tabItem(tabName = "dashboard",
actionButton("showTable", "Show Table", icon = icon("table"))
##fluidRow( DT::dataTableOutput('tbl') )
## SOME CODE TO SHOW DATA TABLE IN MODAL
)
)
)
)
server <- function(input, output) {
output$tbl = DT::renderDataTable(
iris, options = list(lengthChange = FALSE)
)
}
shinyApp(ui, server)