You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, this magic only works for a static DT table, i.e., the table generated by DT::datatable() directly.
If the table is generated by DT::renderDT(), i.e., on the shiny runtime, DT.fillContainer option won't be set to TRUE and the table rendered may be displayed in an undesired style, when the container's height is limited. What's worse is, users can't even view the hidden data rows, since there's no Y-scroller.
It's very confused to the user and it's difficult to know that this can be resolved by providing the fillContainer = TRUE to the DT::datatable() call.
Since FlexDashboard has already does this magic (rendering DT table with DT.fillContainer option being set to TRUE) to the static DT, I'm asking the question that :
Can FlexDashboard render a reactive DT table (shiny runtime) with DT.fillContainer option being set to TRUE, automatically?
If not, is it possible to do it in DT? I mean, is it possible for DT to know that it's rendering within a FlexDashboard?
An Example to illustrate what I say (See the comment on the sidebar)
---title: "Test Flexboard Shiny App"runtime: shinyoutput:
flexdashboard::flex_dashboard:
orientation: columnsvertical_layout: fill---```{r setup, include=FALSE}
library(flexdashboard)library(shiny)library(DT)```
Sidebar {.sidebar}
-----------------------------------------------------------------------
Please pay attention to the scrollY bar of each table.
- The 2nd table's scroll bar can't be displayed but the 1st and 3rd can.
- The reason is that DT table need `fillContainer` to be set to `TRUE` in order to display correctly.
- FlexDashboard is able to enable this option for static DT table but not for DT in Shiny mode.
Column Data
-----------------------------------------------------------------------### 1. shiny - fillContainer = TRUE```{r}DT::renderDT(DT::datatable( mtcars, fillContainer = TRUE))```### 2. shiny - no fillContainer```{r}DT::renderDT(DT::datatable( mtcars))```### 3. static - no fillContainer```{r}DT::datatable( mtcars)```
The text was updated successfully, but these errors were encountered:
When using flexdashboard with DT tables, the DT table will be vertically filled automatically, thanks to the following lines :
flexdashboard/R/flex_dashboard.R
Lines 189 to 194 in 6ad5ace
However, this magic only works for a static DT table, i.e., the table generated by
DT::datatable()
directly.If the table is generated by
DT::renderDT()
, i.e., on the shiny runtime,DT.fillContainer
option won't be set toTRUE
and the table rendered may be displayed in an undesired style, when the container's height is limited. What's worse is, users can't even view the hidden data rows, since there's no Y-scroller.It's very confused to the user and it's difficult to know that this can be resolved by providing the
fillContainer = TRUE
to theDT::datatable()
call.Since FlexDashboard has already does this magic (rendering DT table with
DT.fillContainer
option being set toTRUE
) to the static DT, I'm asking the question that :Can FlexDashboard render a reactive DT table (shiny runtime) with
DT.fillContainer
option being set toTRUE
, automatically?If not, is it possible to do it in DT? I mean, is it possible for DT to know that it's rendering within a FlexDashboard?
Thanks!
(Ref to rstudio/DT#818)
An Example to illustrate what I say (See the comment on the sidebar)
The text was updated successfully, but these errors were encountered: