shiny icons in DataTable

205 views
Skip to first unread message

lukasz...@gmail.com

unread,
Apr 5, 2017, 3:22:15 AM4/5/17
to Shiny - Web Framework for R
Hi I am trying to display font-awsome icons in one of the datatable columns



data$Icon <- sapply(filt_data$Icon, function(x)as.character(icon(x)))

datatable(data = data,
              escape = TRUE)


the Icon column contains character like:

"<i class=\"fa fa-long-arrow-right\"><\/i>"

However I am not seeing the icons displayed,

Looks like I need to tell datatable to include font-awsome css stylesheet.

Anyone has an idea how it can be done?

Thanks,

Lukasz

Joe Cheng

unread,
Apr 6, 2017, 1:11:32 PM4/6/17
to lukasz...@gmail.com, Shiny - Web Framework for R
Kind of a kludge but you could put icon("") somewhere else in your UI, that would have the side effect of loading font-awesome.

--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/029d7b46-2497-4472-a86e-fcb296300198%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages