DataTable: DataTable

View source: R/RmarkdownFunctions.R

DataTableR Documentation

DataTable

Description

Fully loaded DT::datatable() with args prefilled

Usage

DataTable(data, FixedCols = 2)

Arguments

data

source data.table

FixedCols

Number of columns from the left to Freeze, like freeze panes in Excel. Default is 2

Author(s)

Adrian Antico

See Also

Other Shiny: DataTable2()

Examples

## Not run: 
# Rmarkdown example of DataTable 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::DataTable(data)
````

# Shiny Usage
output$Table <- shiny::renderUI({AutoQuant::DataTable(data)})


## End(Not run)


AdrianAntico/ModelingTools documentation built on Feb. 1, 2024, 7:33 a.m.