-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
renderDataTable.Rd
96 lines (85 loc) · 3.46 KB
/
renderDataTable.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/bootstrap.R, R/shinywrappers.R
\name{dataTableOutput}
\alias{dataTableOutput}
\alias{renderDataTable}
\title{Table output with the JavaScript DataTables library}
\usage{
dataTableOutput(outputId)
renderDataTable(
expr,
options = NULL,
searchDelay = 500,
callback = "function(oTable) {}",
escape = TRUE,
env = parent.frame(),
quoted = FALSE,
outputArgs = list()
)
}
\arguments{
\item{outputId}{output variable to read the table from}
\item{expr}{An expression that returns a data frame or a matrix.}
\item{options}{A list of initialization options to be passed to DataTables,
or a function to return such a list. You can find a complete list of
options at \url{https://datatables.net/reference/option/}.
Any top-level strings with class \code{"AsIs"} (as created by \code{\link[=I]{I()}}) will be
evaluated in JavaScript. This is useful when the type of the option value
is not supported in JSON, e.g., a JavaScript function, which can be
obtained by evaluating a character string. This only applies to the
root-level elements of options list, and does not worked for lower-level
elements in the list.}
\item{searchDelay}{The delay for searching, in milliseconds (to avoid too
frequent search requests).}
\item{callback}{A JavaScript function to be applied to the DataTable object.
This is useful for DataTables plug-ins, which often require the DataTable
instance to be available.}
\item{escape}{Whether to escape HTML entities in the table: \code{TRUE} means
to escape the whole table, and \code{FALSE} means not to escape it.
Alternatively, you can specify numeric column indices or column names to
indicate which columns to escape, e.g. \code{1:5} (the first 5 columns),
\code{c(1, 3, 4)}, or \code{c(-1, -3)} (all columns except the first and
third), or \code{c('Species', 'Sepal.Length')}.}
\item{env}{The parent environment for the reactive expression. By default,
this is the calling environment, the same as when defining an ordinary
non-reactive expression. If \code{expr} is a quosure and \code{quoted} is \code{TRUE},
then \code{env} is ignored.}
\item{quoted}{If it is \code{TRUE}, then the \code{\link[=quote]{quote()}}ed value of \code{expr}
will be used when \code{expr} is evaluated. If \code{expr} is a quosure and you
would like to use its expression as a value for \code{expr}, then you must set
\code{quoted} to \code{TRUE}.}
\item{outputArgs}{A list of arguments to be passed through to the implicit
call to \code{dataTableOutput()} when \code{renderDataTable()} is used
in an interactive R Markdown document.}
}
\description{
\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}}
This function is deprecated, use
\href{https://rstudio.github.io/DT/shiny.html}{DT::renderDT()} instead. It
provides a superset of functionality, better performance, and better user
experience.
}
\examples{
## Only run this example in interactive R sessions
if (interactive()) {
# pass a callback function to DataTables using I()
shinyApp(
ui = fluidPage(
fluidRow(
column(12,
dataTableOutput('table')
)
)
),
server = function(input, output) {
output$table <- renderDataTable(iris,
options = list(
pageLength = 5,
initComplete = I("function(settings, json) {alert('Done.');}")
)
)
}
)
}
}
\keyword{internal}