shiny
shiny copied to clipboard
renderDataTable's lengthMenu content not showing
System details
Browser Version: Latest Opera and Chrome
Output of sessionInfo():
> sessionInfo()
R version 4.3.3 (2024-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.4 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
time zone: Europe/Moscow
tzcode source: system (glibc)
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] dplyr_1.1.0 readxl_1.4.2 DT_0.27 shiny_1.7.4
loaded via a namespace (and not attached):
[1] zip_2.3.0 vctrs_0.5.2 cli_3.6.0 rlang_1.0.6 stringi_1.7.12 promises_1.2.0.1 generics_0.1.3 xtable_1.8-4 glue_1.6.2
[10] htmltools_0.5.4 httpuv_1.6.9 fansi_1.0.4 cellranger_1.1.0 tibble_3.1.8 ellipsis_0.3.2 fastmap_1.1.1 openxlsx_4.2.5.2 lifecycle_1.0.3
[19] compiler_4.3.3 pkgconfig_2.0.3 htmlwidgets_1.6.1 Rcpp_1.0.10 rstudioapi_0.14 later_1.3.0 digest_0.6.31 R6_2.5.1 tidyselect_1.2.0
[28] utf8_1.2.3 pillar_1.8.1 magrittr_2.0.3 tools_4.3.3 mime_0.12
Example application or steps to reproduce the problem
renderDF <- function(df, ...) {
return(DT::renderDataTable(DT::datatable({df},
extensions = "Buttons",
class = "display nowrap compact cell-border",
filter = "top",
options = list(
paging = TRUE,
pageLength = 30,
lengthMenu = list(c(30, 50, 100, 200, 500, 1000, -1),
c('Test 30', 'Test 50', 'Test 100', 'Test 200', 'Test 500', 'Test 1000', 'Test')),
search = list(regex = TRUE),
# autoWidth = TRUE,
clear = FALSE,
plain = TRUE,
dom = 'Bfrtip',
buttons = list(
"pageLength",
"excel",
"colvis"
),
...
)))
}
Describe the problem in detail
I want to change text on lengthMenu button, but for some reason it changes only in dropdown, not in rendered button itself: