Skip to contents

[Stable]

Usage

get_dt_rows(dt_name, dt_rows)

Arguments

dt_name

ns() of inputId of the DT::datatable

dt_rows

ns() of inputId of the variable that holds the current selected value of lengthMenu

Examples

if (FALSE) {
library(shiny)
# in Shiny UI function
tagList(
  get_dt_rows(ns("data_table"), ns("dt_rows")),
  ...
)

# use the input$dt_rows in the Shiny Server function
if (!is.null(input$dt_rows)) {
  dt_args$options$pageLength <- input$dt_rows
} # nolint
do.call(DT::datatable, dt_args)
}