View source: R/RmarkdownFunctions.R
DataTable2 | R Documentation |
Fully loaded DT::datatable() with args prefilled
DataTable2(data, FixedCols = 2L)
data |
source data.table |
FixedCols |
= 2L |
Adrian Antico
Other Shiny:
DataTable()
## Not run:
# Rmarkdown example of DataTable2 inside a <details> </Details> section
```{r Get Dependencies For DT::datatable(), echo=FALSE,include = FALSE}
# You need this code to conduct the magic dependences attaching...
DT::datatable(matrix())
```
```{js Nest All DT::datatable() inside a details drop down, echo=FALSE}
setTimeout(function() {
var codes = document.querySelectorAll('.dataTables_wrapper');
var code, i, d, s, p;
for (i = 0; i < codes.length; i++) {
code = codes[i];
p = code.parentNode;
d = document.createElement('details');
s = document.createElement('summary');
s.innerText = 'Details';
// <details><summary>Details</summary></details>
d.appendChild(s);
// move the code into <details>
p.replaceChild(d, code);
d.appendChild(code);
}
});
```
```{r Example, echo = FALSE}
AutoQuant::DataTable2(data)
````
# Shiny Usage
output$Table <- shiny::renderUI({AutoQuant::DataTable2(data)})
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.