javascriptrshinybootstrap-4dt

"next" button showing as text for R Shiny DataTable using Bootstrap


Normally, Shiny DT will have buttons visible to view the next X amount of records. When specifying style="bootstrap", those buttons turn into the text, "previous12345...8Next" although they are still clickable links. What can I do to render the buttons properly?

if (interactive()) {
  library(shiny)
  library(DT)
  library(bs4Dash)

  # width dataframe as input
  shinyApp(
    ui = dashboardPage(

      header = dashboardHeader(),
      sidebar = dashboardSidebar(),
      body = dashboardBody(

        fluidRow(column(12, DT::dataTableOutput('mytable')))
      ),
      footer = dashboardFooter()
    ),
    server = function(input, output) {
      output$mytable <- DT::renderDataTable(iris,
                                            #extensions = "FixedHeader",
                                            style="bootstrap",
                                            options = list(
                                              dom = 'Bfrtip',
                                              lengthMenu = c(50, 100),
                                              pageLength = 20,
                                              scrollX=TRUE,
                                              autoWidth = TRUE,
                                              paging=TRUE,
                                              searching=FALSE,
                                              ordering=TRUE
                                              #fixedHeader = TRUE,
                                            ))
    }
  )
}

Solution

  • specifying style="bootstrap4" in place of style="bootstrap" under DT::renderDataTable() solves this issue