How to? Infinite scroll in DataTables for shiny 10.2 and above

2,794 views
Skip to first unread message

Willi Fiebranz

unread,
Jan 6, 2015, 8:02:58 AM1/6/15
to shiny-...@googlegroups.com
Hi,

due to the latest update of the dataTable option parameters, I do not manage to regain the power of infinite scrolling dataTable content.

The "bScrollInfinite" does not work anymore, but the "dom" alternative via using the Scroller plugin does not seem to take any desired effect.

Does someone have a similar problem or has someone found a solution with a working code example (from R/shiny, NOT in general  for DataTables)?

Regards...

Yihui Xie

unread,
Jan 6, 2015, 11:56:06 AM1/6/15
to Willi Fiebranz, shiny-discuss
According to http://legacy.datatables.net/ref, this option has been
deprecated, and replaced by sScrollY later. Then DataTables 1.10.x
replaced it by scrollY: https://datatables.net/upgrade/1.10-convert
Then what you should really look at is:
http://datatables.net/reference/option/scrollY

Here is a minimal example:

library(shiny)
shinyApp(
ui = fluidPage(fluidRow(dataTableOutput('foo'))),
server = function(input, output) {
output$foo = renderDataTable({
iris
}, options = list(
scrollY = '300px', paging = FALSE
))
}
)

Regards,
Yihui
> --
> You received this message because you are subscribed to the Google Groups
> "Shiny - Web Framework for R" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to shiny-discus...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/shiny-discuss/05d1c6f3-df15-4e96-b87b-d845a13dc403%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Willi Fiebranz

unread,
Jan 7, 2015, 3:35:02 AM1/7/15
to shiny-...@googlegroups.com, willi.f...@gmail.com
Hello, thanks for your reply.

While your example scrolls the whole table, it is not what I am looking for. You loaded the whole table on one page, which could become troublesome when you use very large tables.

What I was looking for is and working implementation of this new DataTable syntax in shiny: https://datatables.net/extensions/scroller/

It seems pretty cool...

Yihui Xie

unread,
Mar 4, 2015, 12:42:16 PM3/4/15
to Willi Fiebranz, shiny-discuss
I have implemented the scroller in the DT package, and you can find
examples here: http://rstudio.github.io/DT/extensions.html#scroller

Regards,
Yihui
Reply all
Reply to author
Forward
0 new messages