|
64 | 64 | #' (only display the table body) when the number of total records is less
|
65 | 65 | #' than the page size. Note, it only works on the client-side processing mode
|
66 | 66 | #' and the `pageLength` option should be provided explicitly.
|
| 67 | +#' @param lazyRender \code{TRUE} to delay rendering until the table becomes visible |
| 68 | +#' (the default) or \code{FALSE} to render the table immediately on page load. |
67 | 69 | #' @param selection the row/column selection mode (single or multiple selection
|
68 | 70 | #' or disable selection) when a table widget is rendered in a Shiny app;
|
69 | 71 | #' alternatively, you can use a list of the form \code{list(mode = 'multiple',
|
@@ -207,6 +209,7 @@ datatable = function(
|
207 | 209 | escape = TRUE, style = 'auto', width = NULL, height = NULL, elementId = NULL,
|
208 | 210 | fillContainer = getOption('DT.fillContainer', NULL),
|
209 | 211 | autoHideNavigation = getOption('DT.autoHideNavigation', NULL),
|
| 212 | + lazyRender = TRUE, |
210 | 213 | selection = c('multiple', 'single', 'none'), extensions = list(), plugins = NULL,
|
211 | 214 | editable = FALSE
|
212 | 215 | ) {
|
@@ -375,6 +378,9 @@ datatable = function(
|
375 | 378 | params$autoHideNavigation = autoHideNavigation
|
376 | 379 | }
|
377 | 380 |
|
| 381 | + # record lazyRender |
| 382 | + params$lazyRender = lazyRender |
| 383 | + |
378 | 384 | params = structure(modifyList(params, list(
|
379 | 385 | data = data, container = as.character(container), options = options,
|
380 | 386 | callback = if (!missing(callback)) JS('function(table) {', callback, '}')
|
|
0 commit comments