Comments (10)
Thanks for the feedback. You need the development version of shiny:
devtools::install_github('rstudio/shiny')
from dt.
Thanks
Is there something different I need to do with renderDataTable now?
in the development version
a shinyApp that works under the CRAN version 0.10.2.2 breaks, producing
cells showing the html text (<table cellpadding='4' etc.) rather than rendering it as below?
Whatcha Gonna Do About It |
---|
First Entered: 1965-09-11 |
Highest Position: 14 |
Weeks in Top 40: 10 |
from dt.
Could you provide a minimal reproducible example?
from dt.
---
title: "Untitled"
author: "pssguy"
date: "Monday, December 22, 2014"
output: html_document
runtime: shiny
---
```{r, echo=FALSE, message=FALSE}
df <- data.frame(summary=c("<table cellpadding='4' style='line-height:1'><tr>\n <th>Whatcha Gonna Do About It</th></tr>\n \n <tr align='left'>\n <td>First Entered: 1965-09-11</td></tr>\n <tr align='left'><td>Highest Position: 14</td></tr>\n <tr align='left'><td>Weeks in Top 40: 10</td></tr>\n \n \n </table>"), video=c("<iframe src='https://www.youtube.com/embed/mYvi-l2SRnA?wmode=opaque&feature=oembed' frameborder='0' allowfullscreen=''></iframe>"))
renderDataTable({df})
```
from dt.
BTW how do I avoid an R Markdown example rendering? Hope you can follow that there is a data.frame
with 1 row of 2 variables which is then just rendered
Confirmed that this code opens fine with CRAN shiny but not after
library(devtools)
install_github('rStudio/shiny')
from dt.
@pssguy You need to indent the example by 4 spaces: https://github.com/yihui/knitr/blob/master/CONTRIBUTING.md
The Github version of shiny added an escape
argument to renderDataTable()
: https://github.com/rstudio/shiny/blob/master/NEWS You need to set it to FALSE. But note I have not added it to the DT package yet, which I should have done.
from dt.
@yihui
a)Thanks - corrected above
b)Guess I should have read the notes. My bad. What are the security implications?
from dt.
@pssguy In general, you should not allow unescaped HTML content in your app, otherwise you might be subject to XSS attacks: http://en.wikipedia.org/wiki/Cross-site_scripting I guess I'd better not discuss it in detail in the public. In your case, the input is a fixed data frame, and it is probably safe.
from dt.
Thanks for link. Hopefully, this will be OK as is. Is there an alternative approach you know of if I want to embed a youtube video?
from dt.
I do not see why embedding a Youtube video needs DataTables. Why not just something like
tags$iframe(src='https://www.youtube.com/embed/mYvi-l2SRnA?wmode=opaque&feature=oembed')
in ui.R? If you just need the table layout, you can use column()
in fluidRow()
(http://shiny.rstudio.com/articles/layout-guide.html), or write a plain table
tags$table(...)
instead of a DataTable.
from dt.
Related Issues (20)
- Handle NULL return from bslib::theme_version HOT 4
- Dataframe with POSIXlt data type leads to Error: C stack usage 7954712 is too close to the limit HOT 4
- update description of colReorder's order parameter HOT 5
- Error in isRowColList since R 4.3.0 HOT 1
- Scroller extension incompatible with dark themes
- two "remove" icons in filtered filter = 'top'? HOT 2
- plugins = 'natural' not working for DT v > .27? HOT 3
- 503 error with very large http cookies
- Issue using `replaceData()` with `dataTableProxy()` HOT 4
- `formatStyle()` doesn't work with Bootstrap 5 HOT 5
- Cannot be rendered correctly in Shiny app with tailwind css HOT 3
- some selected rows loose bg (bootstrap 5, rowGroup extension, selection)
- Selection of multiple levels HOT 2
- [Accessibility] Trigger custom row select from Javascript callback HOT 11
- R shiny DT table with pagination and drop down list inside table and being able to save the entire updated table as csv file HOT 5
- DT 0.31 breaks previous 'ignore colnames' behavior during `replaceData()` HOT 1
- RowGroup extension with rownames = TRUE HOT 6
- updateSearch does not update numeric slider values
- datatable column filters clash with shiny::selectizeInput when invoked first HOT 4
- DateTime date picker CSS is broken in SearchBuilder
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dt.