R/data_table_ui.R

Defines functions data_table_ui

Documented in data_table_ui

#' Data Table UI
#'
#' @param id a shiny id
#' @param message_html sent to messageBox
#' @param button_text a string
#'
#' @export
data_table_ui <- function(
    id,
    message_html = "",
    button_text = "Download datatable"
){

    ns <- shiny::NS(id)

    shiny::tagList(
        iatlas.modules::messageBox(width = 12, message_html),
        shiny::fluidRow(
            iatlas.modules::tableBox(
                width = 12,
                shiny::div(
                    style = "overflow-x: scroll",
                    "data_table" %>%
                        ns() %>%
                        DT::dataTableOutput(.) %>%
                        shinycssloaders::withSpinner(.)
                )
            ),
            shiny::downloadButton(ns("download_table"), button_text)
        )
    )
}
CRI-iAtlas/iatlas.modules2 documentation built on Dec. 19, 2024, 8:14 p.m.