Open nitingupta2 opened 4 years ago
I can confirm that this is an ongoing issue; including after the most recent release 17 days ago.
> xfun::session_info('DT')
R version 4.0.2 (2020-06-22)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.5 LTS, RStudio 1.3.959
Locale:
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 LC_PAPER=en_US.UTF-8 LC_NAME=C
LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
Package version:
base64enc_0.1.3 BH_1.72.0.3 crosstalk_1.1.0.1 digest_0.6.25 DT_0.15.4 graphics_4.0.2
grDevices_4.0.2 htmltools_0.5.0 htmlwidgets_1.5.1 jsonlite_1.7.0 later_1.1.0.1 lazyeval_0.2.2
magrittr_1.5 methods_4.0.2 promises_1.1.1 R6_2.4.1 Rcpp_1.0.5 rlang_0.4.7
stats_4.0.2 utils_4.0.2 yaml_2.2.1
>
Would appreciate if a package maintainer could comment whether this issue is under review.
Thank you.
Thanks for reporting this issue. I can confirm it. I'm investigating this now...
OK, adding fillContainer = TRUE
to datatable()
will resolve this. (Ref to #243)
Here're some facts:
The datatables javascript library lacks the ability to become scrollable on Y axis automatically (it has scrollY option, but it needs to be specified in advance). This should be the reason of PR #243.
The reason of using datatable()
directly in flexdashboard works while renderDT()
not is the fillContainer
param is enabled by default in the former cases.
So we'd better enable fillContainer
for renderDT()
in Flexdashboard automatically.
@nitingupta2 As of your problem, I mean changing the chunk as below will be enough :
### renderDataTable (reactive)
```{r}
DT::renderDataTable(datatable(mydataset(), rownames = TRUE,
options = list(bPaginate = FALSE, searching = FALSE, info = FALSE),
fillContainer = TRUE))
Well, now it looks like an issue of FlexDashboard to me, as the fillContainer
option should be enable there:
However, under Shiny mode, these lines will fail to work, apparently.
So I will file an issue on FlexDashboard.
Quite possibly a bug - not sure whether in
DT
orflexdashboard
.Here's the problem: I'm rendering a datatable in a shiny flexdashboard app in a reactive context, so that it updates when an input in changed. My dataset isn't large enough to use pagination, so the user should be able to scroll in Y direction to see all records. However, scroll bars do not appear when the table is updated in
renderDataTable
.This issue has been asked on StackOverflow here without a satisfactory resolution.
Here's how the problem can be reproduced within a simple shiny flexdashboard Rmd file. In comparison, the scroll bars appear in
renderTable
as expected. Similarly, datatable also works as expected when used in a non-reactive context with a fixed input.To be sure, I have tried both the current CRAN and development versions of
DT
andflexdashboard
without success.Sidebar {.sidebar}
Column {data-width=500}
renderTable (reactive)
Column {data-width=500}
renderDataTable (reactive)
datatable (fixed input)
Created on 2020-06-08 by the reprex package (v0.3.0)
By filing an issue to this repo, I promise that
xfun::session_info('DT')
. I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version:remotes::install_github('rstudio/DT')
.I understand that my issue may be closed if I don't fulfill my promises.