EVOLUTION-MANAGER
Edit File: renderDataTable.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Table output with the JavaScript library DataTables</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for renderDataTable {shiny}"><tr><td>renderDataTable {shiny}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Table output with the JavaScript library DataTables</h2> <h3>Description</h3> <p>Makes a reactive version of the given function that returns a data frame (or matrix), which will be rendered with the DataTables library. Paging, searching, filtering, and sorting can be done on the R side using Shiny as the server infrastructure. </p> <h3>Usage</h3> <pre> renderDataTable( expr, options = NULL, searchDelay = 500, callback = "function(oTable) {}", escape = TRUE, env = parent.frame(), quoted = FALSE, outputArgs = list() ) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>expr</code></td> <td> <p>An expression that returns a data frame or a matrix.</p> </td></tr> <tr valign="top"><td><code>options</code></td> <td> <p>A list of initialization options to be passed to DataTables, or a function to return such a list.</p> </td></tr> <tr valign="top"><td><code>searchDelay</code></td> <td> <p>The delay for searching, in milliseconds (to avoid too frequent search requests).</p> </td></tr> <tr valign="top"><td><code>callback</code></td> <td> <p>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 (<a href="http://datatables.net/extensions/">http://datatables.net/extensions/</a>).</p> </td></tr> <tr valign="top"><td><code>escape</code></td> <td> <p>Whether to escape HTML entities in the table: <code>TRUE</code> means to escape the whole table, and <code>FALSE</code> 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</code> (the first 5 columns), <code>c(1, 3, 4)</code>, or <code>c(-1, -3)</code> (all columns except the first and third), or <code>c('Species', 'Sepal.Length')</code>.</p> </td></tr> <tr valign="top"><td><code>env</code></td> <td> <p>The environment in which to evaluate <code>expr</code>.</p> </td></tr> <tr valign="top"><td><code>quoted</code></td> <td> <p>Is <code>expr</code> a quoted expression (with <code>quote()</code>)? This is useful if you want to save an expression in a variable.</p> </td></tr> <tr valign="top"><td><code>outputArgs</code></td> <td> <p>A list of arguments to be passed through to the implicit call to <code><a href="tableOutput.html">dataTableOutput()</a></code> when <code>renderDataTable</code> is used in an interactive R Markdown document.</p> </td></tr> </table> <h3>Details</h3> <p>For the <code>options</code> argument, the character elements that have the class <code>"AsIs"</code> (usually returned from <code><a href="../../base/html/AsIs.html">base::I()</a></code>) 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. Note this only applies to the root-level elements of the options list, and the <code>I()</code> notation does not work for lower-level elements in the list. </p> <h3>Note</h3> <p>This function only provides the server-side version of DataTables (using R to process the data object on the server side). There is a separate package <span class="pkg">DT</span> (<a href="https://github.com/rstudio/DT">https://github.com/rstudio/DT</a>) that allows you to create both server-side and client-side DataTables, and supports additional DataTables features. Consider using <code>DT::renderDataTable()</code> and <code>DT::dataTableOutput()</code> (see <a href="http://rstudio.github.io/DT/shiny.html">http://rstudio.github.io/DT/shiny.html</a> for more information). </p> <h3>References</h3> <p><a href="http://datatables.net">http://datatables.net</a> </p> <h3>Examples</h3> <pre> ## 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.');}") ) ) } ) } </pre> <hr /><div style="text-align: center;">[Package <em>shiny</em> version 1.5.0 <a href="00Index.html">Index</a>]</div> </body></html>